diff options
Diffstat (limited to 'WebCore/mathml/RenderMathMLBlock.cpp')
-rw-r--r-- | WebCore/mathml/RenderMathMLBlock.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/WebCore/mathml/RenderMathMLBlock.cpp b/WebCore/mathml/RenderMathMLBlock.cpp index 249c136..a897ff5 100644 --- a/WebCore/mathml/RenderMathMLBlock.cpp +++ b/WebCore/mathml/RenderMathMLBlock.cpp @@ -30,6 +30,7 @@ #include "RenderMathMLBlock.h" #include "FontSelector.h" +#include "GraphicsContext.h" #include "MathMLNames.h" #include "RenderInline.h" #include "RenderText.h" @@ -73,6 +74,39 @@ void RenderMathMLBlock::stretchToHeight(int height) } } +#if ENABLE(DEBUG_MATH_LAYOUT) +void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty) +{ + RenderBlock::paint(info, tx, ty); + + if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground) + return; + + tx += x(); + ty += y(); + + info.context->save(); + + info.context->setStrokeThickness(1.0f); + info.context->setStrokeStyle(SolidStroke); + info.context->setStrokeColor(Color(0, 0, 255), sRGBColorSpace); + + info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty)); + info.context->drawLine(IntPoint(tx + offsetWidth(), ty), IntPoint(tx + offsetWidth(), ty + offsetHeight())); + info.context->drawLine(IntPoint(tx, ty + offsetHeight()), IntPoint(tx + offsetWidth(), ty + offsetHeight())); + info.context->drawLine(IntPoint(tx, ty), IntPoint(tx, ty + offsetHeight())); + + int baseline = baselinePosition(true); + + info.context->setStrokeColor(Color(255, 0, 0), sRGBColorSpace); + + info.context->drawLine(IntPoint(tx, ty + baseline), IntPoint(tx + offsetWidth(), ty + baseline)); + + info.context->restore(); + +} +#endif // ENABLE(DEBUG_MATH_LAYOUT) + } |