[whatwg] CanvasRenderingContext2D with addPath, currentPath
cabanier at gmail.com
Fri Sep 28 12:17:12 PDT 2012
On Fri, Sep 28, 2012 at 9:31 AM, Dirk Schulze <dschulze at adobe.com> wrote:
> Would it be possible to extend CanvasRenderingContext2D with the functions:
> void addPath(Path path); - which adds a Path object to the current path on
> attribute Path currentPath; - that returns a copy of the current path, or
> let you replace the current path with another Path object (not live)?
> These could possibly also replace clip(Path), fill(Path), stroke(Path),
> drawSystemFocusRing(Path path...), isPointInPath(Path path…).
I like the 'op(path)' operators so I'd rather not see them go.
'currentPath' should return a read-only copy (and not be live)
> It needs to be clarified what happens for this case:
> var path = new Path();
> ctx.currentPath = path;
> The pendant on CanvasRenderingContext2D:
> would do a moveTo(20,20) internally. Should Path do the same? This problem
> exists for fill(Path path) at the moment as well, if I did not miss a line.
> Qt for instance adds a moveTo(0,0) at the beginning if no current point was
> specified, other platforms behave differently.
Yes, but the 'moveTo' would happen when you call the fill. The path itself
should just be geometry.
One question is what happen to the current path when you call 'op(path)'
since that is not defined in the current spec. I believe the current path
should be ignored and only the argument drawn.
> PS: I send this mail to the WHATWG mailing list as well.
More information about the whatwg