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

Re: [whatwg] [canvas] Path object

From: Charles Pritchard <chuck@jumis.com>
Date: Sat, 22 Sep 2012 22:50:54 -0700
Message-Id: <CC6D7BAF-A375-41A5-BA0A-F6847F25E130@jumis.com>
To: Elliott Sprehn <esprehn@gmail.com>
Cc: WHATWG <whatwg@whatwg.org>
We proposed this in the public-canvas-api working group.

There may be some tricky parts with transforms.

From an implementation perspective, createPath (returns opaque CanvasPath) and beginPath(CanvasPath) is the easiest and most direct. The tricky part happens when you're in a loop with transforms as: rotate(15); beginPath(createPath()); will rotate another 15 degrees because the transform is applied twice.

Of course, if you've worked with canvas and pattern before, you're used to handling inverse transforms when appopriate.


On Sep 22, 2012, at 9:17 PM, Elliott Sprehn <esprehn@gmail.com> wrote:

> I was looking at the canvas Path API and had some concerns. In
> particular it's inconsistent with the rest of canvas:
> We already have CanvasGradient and CanvasPattern in the global
> namespace, so this should probably be called CanvasPath.
> We also have createLinearGradient() and createPattern(), but this new
> thing is "new Path".
> Could we get some consistency here? Like adding new CanvasGradient()
> (or a createPath() method) to match up with Path and renaming this
> thing CanvasPath?
> - Elliott
Received on Sunday, 23 September 2012 05:51:28 UTC

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