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

Unified Diff: Source/modules/canvas2d/EventHitRegion.cpp

Issue 1259973002: Canvas2d: Remove unnecessary conversion in EventHitRegion. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | Source/modules/canvas2d/HitRegion.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/canvas2d/EventHitRegion.cpp
diff --git a/Source/modules/canvas2d/EventHitRegion.cpp b/Source/modules/canvas2d/EventHitRegion.cpp
index cb28d9cc54e9af890040fb472b4ef454ddcf34cc..51ae9d2ba1a1f3f78a127820220f5bbd2c4e0c8d 100644
--- a/Source/modules/canvas2d/EventHitRegion.cpp
+++ b/Source/modules/canvas2d/EventHitRegion.cpp
@@ -25,15 +25,14 @@ String EventHitRegion::regionIdFromAbsoluteLocation(HTMLCanvasElement& canvas, c
// Adjust offsetLocation to be relative to the canvas's position.
LayoutObject* layoutObject = canvas.layoutObject();
FloatPoint localPos = layoutObject->absoluteToLocal(FloatPoint(location), UseTransforms);
- LayoutPoint localLayoutPoint = roundedLayoutPoint(localPos);
LocalFrame* frame = document.frame();
float zoomFactor = frame ? frame->pageZoomFactor() : 1;
float scaleFactor = 1 / zoomFactor;
if (scaleFactor != 1.0f)
- localLayoutPoint.scale(scaleFactor, scaleFactor);
+ localPos.scale(scaleFactor, scaleFactor);
- HitRegion* hitRegion = toCanvasRenderingContext2D(context)->hitRegionAtPoint(localLayoutPoint);
+ HitRegion* hitRegion = toCanvasRenderingContext2D(context)->hitRegionAtPoint(localPos);
if (!hitRegion || hitRegion->id().isEmpty())
return String();
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | Source/modules/canvas2d/HitRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698