[whatwg] isPointInPath on Path object

Dirk Schulze dschulze at adobe.com
Thu Sep 20 13:13:59 PDT 2012


Hi,

The interface of CanvasRenderingContext2D currently has a function called isPointInPath() with a Path object as input [1]. I wonder why this needs to be on the context interface. Wouldn't it make more sense on the interface of Path object itself? If an implementation really needs a context to get a point on a path it, it can create it on it's own.

The only situation that might be reasonable would be a transform on the Canvas that an author want to cover in the Path. But for the rare case where this matters, you can create a new Path object, add your path with the transform and call isPointInPath.

Furthermore, a transform() function that applies to a Path object seems to be useable as well. But that can be discussed on a different mail.

Greetings,
Dirk

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#2dcontext


More information about the whatwg mailing list