Index: Source/core/paint/SVGTextPainter.cpp |
diff --git a/Source/core/paint/SVGTextPainter.cpp b/Source/core/paint/SVGTextPainter.cpp |
index 5c80177165e5aa16d99883d9556de86be56264b0..5779c840efe4888c2239ead579cea4b9d7599f84 100644 |
--- a/Source/core/paint/SVGTextPainter.cpp |
+++ b/Source/core/paint/SVGTextPainter.cpp |
@@ -8,6 +8,7 @@ |
#include "core/paint/BlockPainter.h" |
#include "core/rendering/PaintInfo.h" |
#include "core/rendering/svg/RenderSVGText.h" |
+#include "core/rendering/svg/SVGRenderSupport.h" |
#include "platform/graphics/GraphicsContextStateSaver.h" |
namespace blink { |
@@ -22,6 +23,12 @@ void SVGTextPainter::paint(const PaintInfo& paintInfo) |
blockInfo.applyTransform(m_renderSVGText.localToParentTransform(), &stateSaver); |
+ // When transitioning from SVG to HTML painters we need to keep the PaintInfo rect up-to-date |
+ // because it can be used for clipping. |
+ // FIXME: We need to find an approach that's not O(n^2). |
+ const AffineTransform& transform = SVGRenderSupport::transformToRootBorderBox(m_renderSVGText, m_renderSVGText.localToParentTransform()); |
+ blockInfo.rect = enclosingIntRect(transform.mapRect(FloatRect(blockInfo.rect))); |
+ |
BlockPainter(m_renderSVGText).paint(blockInfo, LayoutPoint()); |
// Paint the outlines, if any |