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

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: rebase 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 106c93fae5d436049d583a4aae50282c7165b75e..933275c0f1bb0eb8ece6ccc861e0124b756fc810 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -2394,6 +2394,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);
}
« no previous file with comments | « LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt ('k') | Source/core/html/canvas/HitRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698