Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
| index 97ca82c6c64343e01cc3a24ed2ee8df1d20ea80e..4c2aa337f765e18065ee0ab92ce2a11dc7046bf0 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
| @@ -45,6 +45,17 @@ |
| namespace blink { |
| +void LayoutSVGShape::adjustVisualRectForRasterEffects( |
| + LayoutRect& visualRect) const { |
| + // Account for raster expansions due to SVG stroke hairline raster effects. |
| + if (styleRef().svgStyle().hasVisibleStroke()) { |
|
Xianzhu
2016/10/24 16:17:30
We should add !visualRect.isEmpty() to avoid infla
chrishtr
2016/10/31 20:52:01
Verified done by wangxianzhu.
|
| + float pad = 0.5f; |
|
Xianzhu
2016/10/24 16:17:30
Nit: s/float/LayoutUnit/
chrishtr
2016/10/31 20:52:01
Verified done by wangxianzhu.
|
| + if (styleRef().svgStyle().capStyle() != ButtCap) |
| + pad += 0.5f; |
| + visualRect.inflate(LayoutUnit(pad)); |
| + } |
| +} |
| + |
| LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node) |
| : LayoutSVGModelObject(node), |
| // Default is false, the cached rects are empty from the beginning. |