W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

[whatwg] isPointInPath on Path object

From: Dirk Schulze <dschulze@adobe.com>
Date: Thu, 20 Sep 2012 13:13:59 -0700
To: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>
Message-ID: <088D2EDF-8856-419C-B3C5-B66410E82CE7@adobe.com>
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
Received on Thursday, 20 September 2012 20:14:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC