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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 346003007: Add fillRule option for hit regions on canvas2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index de7a380d673a8cd3a323a79cf499aaecd6e609af..38ec8f4eb74c5f76d1448efa652ef72b1ae6b945 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -2396,6 +2396,14 @@ void CanvasRenderingContext2D::addHitRegion(const Dictionary& options, Exception
}
passOptions.path = specifiedPath;
+
+ String fillRuleString;
+ options.getWithUndefinedOrNullCheck("fillRule", fillRuleString);
+ if (fillRuleString.isEmpty() || fillRuleString != "evenodd")
+ passOptions.fillRule = RULE_NONZERO;
+ else
+ passOptions.fillRule = RULE_EVENODD;
+
addHitRegionInternal(passOptions, exceptionState);
}

Powered by Google App Engine
This is Rietveld 408576698