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

Re: [whatwg] Stroking algorithm in Canvas 2d

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 9 Sep 2013 16:33:57 +0000 (UTC)
To: Rik Cabanier <cabanier@gmail.com>
Message-ID: <alpine.DEB.2.00.1309091626010.12210@ps20323.dreamhostps.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, syhann@adobe.com
On Thu, 5 Sep 2013, Rik Cabanier wrote:
> 
> we've looked over the algorithm in the Canvas spec that describes how
> strokes are computed. [1]
> We think that this section is making some incorrect assumptions. For
> instance, the dashes are calculated over the total lenght of all subpaths,
> but each subpath should be treated separately.

That's intentional, otherwise if you stroke an already-dashed line, you 
get weird results.


> It's also a bit strange that the spec is trying to describe how to stroke.

It's trying to describe sufficient detail to get interoperable behaviour.


> For instance, it goes in minute detail on how dashes are applied but the
> hardest part of stroking ("inflating the paths in path perpendicular to the
> direction") is not described at all.

Is there any ambiguity in the part that's not described?


> Wouldn't it be better to remove all these steps and simply show the 
> desired effect?

Yes. I try to do this as much as possible, but whenever I can't figure out 
a way to describe something declaratively, I describe it imperatively 
instead. If you have a way to describe it that is as precise, covers all 
the same cases, yet is declarative, please don't hesitate to suggest it. I 
unfortunately find that describing things declaratively is usually only 
able to get one 90% of the way to a complete description.


> If not, what would be the best way to fix the wording?

What's wrong with the wording?


> The mailing list or a bug?

Either is fine and equivalent. (Don't do both, though, please!).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 9 September 2013 16:34:21 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:09 UTC