Bug 30402 - [CHROMIUM] Chromium/skia's canvas isPointInPath() implementation is incorrect
Summary: [CHROMIUM] Chromium/skia's canvas isPointInPath() implementation is incorrect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Stephen White
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 12:39 PDT by Stephen White
Modified: 2009-10-16 07:00 PDT (History)
0 users

See Also:


Attachments
Fix for pointInPath() issue. (1.96 KB, patch)
2009-10-15 12:55 PDT, Stephen White
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen White 2009-10-15 12:39:10 PDT
See http//crbug.com/7465:

"Canvas exposes the method isPointInPath. According to the spec, "Points on the path itself 
are considered to be inside the path." So that if you create a rect of size 20x20 at 0,0, 
then the point 0,20 should be in the path. We currently return false, because Skia considers 
the point 0,20 outside the bounds of the rect.

Here's a trivial test case:

ctx = document.getElementById("canvas").getContext("2d");
ctx.save();
ctx.beginPath();
ctx.rect(0, 0, 20, 20);
ctx.isPointInPath(0, 20);
ctx.restore();


See LayoutTests/fast/canvas/pointInPath.html for examples similar to this."
Comment 1 Stephen White 2009-10-15 12:55:21 PDT
Created attachment 41239 [details]
Fix for pointInPath() issue.
Comment 2 Stephen White 2009-10-16 07:00:07 PDT
Landed as http://trac.webkit.org/changeset/49673.  Closing.