W3C home > Mailing lists > Public > public-canvas-api@w3.org > October to December 2013

Re: [whatwg] CanvasRenderingContext2D with addPath, currentPath

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 4 Nov 2013 11:29:57 -0800
Message-ID: <CAGN7qDCmhPPxxfWCThH2yubrheFKykvvuuRMjLtCUzXvzuYMQQ@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: Glenn Maynard <glenn@zewt.org>, "whatwg@whatwg.org" <whatwg@whatwg.org>, "public-canvas-api@w3.org" <public-canvas-api@w3.org>, "Robert O'Callahan" <robert@ocallahan.org>
On Mon, Nov 4, 2013 at 10:36 AM, Dirk Schulze <dschulze@adobe.com> wrote:

>
> On Nov 3, 2013, at 3:22 PM, Glenn Maynard <glenn@zewt.org> wrote:
>
> > On Sat, Nov 2, 2013 at 9:03 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> >
> >>> Does this mean that ctx.currentPath != ctx.currentPath?
> >>
> >> Yes
> >>
> >>> That's bad!
> >>
> >> Why would it be bad (apart from being different)?
> >>
> >
> > It's strange to say "foo.bar.baz = 1" (ctx.currentPath.baz = 1), and for
> > foo.bar.baz to not be 1 the next time you look.  It's also confusing if
> you
> > use it as a Map key.
>
> I think the problem that the UA would be focused with is the following:
>
> var path = ctx1.currentPath;
> ctx2.currentPath = path;
>
> or simply
>
> ctx2.currentPath = ctx1.currentPath
>
> Both contexts could manipulate the same path and both can have different
> CTMs which also change independent of each other. Mixing that up could
> cause a huge mess.
>
> That is one of the reasons why WebKit creates copies.
>

Yes, but the code should have been:

ctx2.SetCurrentPath(ctx1.getCurrentPath());


which arguably doesn't look as elegant.
Received on Monday, 4 November 2013 19:30:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:31:55 UTC