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

Re: Path strings, was: Re: [whatwg] CanvasRenderingContext2D with addPath, currentPath

From: Rik Cabanier <cabanier@gmail.com>
Date: Sun, 3 Nov 2013 19:06:29 -0800
Message-ID: <CAGN7qDDBcEAW1RuO7HeyW39MDVCzWE5zyWmPCu+hV_rkk0MJ9A@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: Canvas <public-canvas-api@w3.org>
Path takes an SVG path string, so you can do:
ctx.currentPath = new Path("...");


On Sun, Nov 3, 2013 at 5:27 PM, Charles Pritchard <chuck@jumis.com> wrote:

>  Any forward progress on supporting SVG path strings?
> That is... ctx.setCurrentPath(DOMString path)
>
> The cost for supporting and maintaining strings is minimal in terms of
> computation/ram/code base size, but it's a consistent pain for developers
> to re-implement.
>
> It's not going to happen, but we could have had ctx.currentPath return a
> string. Then == would have worked.
>

It's better to keep the path opaque. That way we can do operations under
the hood that can't be translated to simple paths (such as union'ing
multiple fills/strokes)

http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-July/032705.html
> http://www.w3.org/2011/07/27-svg-minutes.html#action10
>
>
> -Charles
>
>
> On 11/3/13 5:10 PM, Rik Cabanier wrote:
>
>
>
>
> On Sun, Nov 3, 2013 at 6:22 AM, 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.
>>
>
>  OK. It sounds like this is implemented incorrectly in WebKit then.
> IF we were to implement giving access to the current path, it makes little
> sense to give access to the one that is actively managed by the canvas
> rendering context (= returning it as an attribute) so we should provide
> get/setCurrentPath methods.
>
>
>
Received on Monday, 4 November 2013 03:06:58 UTC

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