W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2014

Re: [whatwg] <canvas> feedback

From: Rik Cabanier <cabanier@gmail.com>
Date: Tue, 8 Apr 2014 17:17:39 -0700
Message-ID: <CAGN7qDBfO_7katfwHTX+CT_HgRcEuq3AL7544y+YTJU54HbahQ@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: WHAT Working Group <whatwg@whatwg.org>
On Tue, Apr 8, 2014 at 4:50 PM, Rik Cabanier <cabanier@gmail.com> wrote:

>
>
>
> On Mon, Apr 7, 2014 at 3:35 PM, Ian Hickson <ian@hixie.ch> wrote:
>
>> ...
>>
>>
>> > > > Stroking will be completely wrong too, because joins and end caps
>> > > > are drawn separately, so they would be stroked as separate paths.
>> > > > This will not give you the effect of a double-stroked path.
>> > >
>> > > I don't understand why you think joins and end caps are drawn
>> > > separately. That is not what the spec requires.
>> >
>> > Sure it does, for instance from
>> >
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#trace-a-path
>> > :
>> >
>> > The round value means that a filled arc connecting the two
>> > aforementioned corners of the join, abutting (and not overlapping) the
>> > aforementioned triangle, with the diameter equal to the line width and
>> > the origin at the point of the join, must be added at joins.
>> >
>> > If you mean, "drawn with a separate fill call", yes that is true.
>> > What I meant was that they are drawn as a separate closed path that will
>> > interact with other paths as soon as there are different winding rules
>> or
>> > "holes".
>>
>> The word "filled" is a bit misleading here (I've removed it), but I don't
>> see why that led you to the conclusion you reached. The step in question
>> begins with "Create a new path that describes the edge of the areas that
>> would be covered if a straight line of length equal to the styles
>> lineWidth was swept along each path in path while being kept at an angle
>> such that the line is orthogonal to the path being swept, replacing each
>> point with the end cap necessary to satisfy the styles lineCap attribute
>> as described previously and elaborated below, and replacing each join with
>> the join necessary to satisfy the styles lineJoin type, as defined below",
>> which seems pretty unambiguous.
>>
>
> Thinking about this some more, it looks like you came around and specified
> stroking like I requested from the beginning.
> For instance,
> http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Oct/0354.html
>  or
> http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Oct/0213.html
> Now that you made that change, 'addPathByStrokingPath' is specified
> correctly. I still don't know how it could be implemented though... (It
> *could* as a shape but not as a path)
>

The spec is still confusingly written and could be misinterpreted:

Create a new path that describes the edge of the areas that would be
covered if a straight line of length equal to the styles lineWidth was
swept along each subpath in path while being kept at an angle such that the
line is orthogonal to the path being swept, replacing each point with the
end cap necessary to satisfy the styles lineCap attribute as described
previously and elaborated below, and replacing each join with the join
necessary to satisfy the styles lineJoin type, as defined below.


Maybe could become:

Create a new path that describes the edge of the coverage of the following
areas:
- a straight line of length equal to the styles lineWidth that was swept
along each subpath in path while being kept at an angle such that the line
is orthogonal to the path being swept,
- the end cap necessary to satisfy the styles lineCap attribute as
described previously and elaborated below,
- the join with the join necessary to satisfy the styles lineJoin type, as
defined below.
Received on Wednesday, 9 April 2014 00:18:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:28 UTC