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

Unified Diff: Source/core/rendering/svg/RenderSVGRect.cpp

Issue 745383007: Fix an issue where hit detection could fail on rect and ellipse shapes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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: Source/core/rendering/svg/RenderSVGRect.cpp
diff --git a/Source/core/rendering/svg/RenderSVGRect.cpp b/Source/core/rendering/svg/RenderSVGRect.cpp
index a8d37354f857f1a685ad47d61c941fcc3601492a..7ed20dd143f12c22faf234b9776405cfe0148a06 100644
--- a/Source/core/rendering/svg/RenderSVGRect.cpp
+++ b/Source/core/rendering/svg/RenderSVGRect.cpp
@@ -62,8 +62,12 @@ void RenderSVGRect::updateShapeFromElement()
// Spec: "A value of zero disables rendering of the element."
if (!boundingBoxSize.isEmpty()) {
- // Fallback to RenderSVGShape if rect has rounded corners or a non-scaling stroke.
- if (rect->rx()->currentValue()->value(lengthContext) > 0 || rect->ry()->currentValue()->value(lengthContext) > 0 || hasNonScalingStroke()) {
+ // Fallback to RenderSVGShape and path-based hit detection if the rect
+ // has rounded corners or a non-scaling or non-smooth stroke.
+ if (rect->rx()->currentValue()->value(lengthContext) > 0
+ || rect->ry()->currentValue()->value(lengthContext) > 0
+ || hasNonScalingStroke()
+ || !hasSmoothStroke()) {
RenderSVGShape::updateShapeFromElement();
m_usePathFallback = true;
return;

Powered by Google App Engine
This is Rietveld 408576698