Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/SVGRootPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp |
| index 14781968a9586066b8e4fc87adf5483ef4b190d7..b4a2d1f996b8e64e4f8440f54ae7e05dea6c6950 100644 |
| --- a/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/SVGRootPainter.cpp |
| @@ -28,9 +28,12 @@ AffineTransform SVGRootPainter::transformToPixelSnappedBorderBox(const LayoutPoi |
| const IntRect snappedSize = pixelSnappedSize(paintOffset); |
| AffineTransform paintOffsetToBorderBox = |
| AffineTransform::translation(snappedSize.x(), snappedSize.y()); |
| - paintOffsetToBorderBox.scale( |
| - snappedSize.width() / m_layoutSVGRoot.size().width().toFloat(), |
| - snappedSize.height() / m_layoutSVGRoot.size().height().toFloat()); |
| + LayoutSize size = m_layoutSVGRoot.size(); |
| + if (!size.isEmpty()) { |
|
pdr.
2016/08/12 17:59:58
If the size is empty, should we be painting anythi
Xianzhu
2016/08/12 18:22:39
I wonder if the early return in SVGRootPaint::pain
|
| + paintOffsetToBorderBox.scale( |
| + snappedSize.width() / size.width().toFloat(), |
| + snappedSize.height() / size.height().toFloat()); |
| + } |
| paintOffsetToBorderBox.multiply(m_layoutSVGRoot.localToBorderBoxTransform()); |
| return paintOffsetToBorderBox; |
| } |