Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp

Issue 2444593002: Introduce Layout*::adjustVisualRectForRasterEffects and use it for SVG hairlines. (Closed)
Patch Set: none Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0ae8ac70581cfc7e6bd4cb514c5ed9e5b7f27b93 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp
@@ -45,6 +45,13 @@
namespace blink {
+void LayoutSVGShape::adjustVisualRectForRasterEffects(
+ LayoutRect& visualRect) const {
+ // Account for raster expansions due to SVG stroke hairline raster effects.
+ if (styleRef().svgStyle().hasStroke())
+ visualRect.expand(IntRectOutsets(2, 2, 2, 2));
chrishtr 2016/10/22 00:01:11 Because this code doesn't understand anything exce
Xianzhu 2016/10/22 00:35:46 It seems too much to expand by 2 pixels each side.
chrishtr 2016/10/22 06:21:04 Done.
+}
+
LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node)
: LayoutSVGModelObject(node),
// Default is false, the cached rects are empty from the beginning.

Powered by Google App Engine
This is Rietveld 408576698