[whatwg] Canvas line styles comments
ian at hixie.ch
Sat Feb 9 17:19:00 PST 2008
On Sat, 2 Feb 2008, Philip Taylor wrote:
> "The lineCap attribute defines the type of endings that UAs shall place
> on the end of lines." - it seems weird to use "shall", since this is the
> only place in the spec (except the list of RFC2119 keywords) that uses
> it. The other line* properties don't try define to conformance
> requirements like that (e.g. they say "The lineWidth attribute gives the
> width of lines" which is only informative), so I can't tell whether the
> lineCap one is trying to be a requirement.
> "The lineJoin attribute defines the type of corners that that UAs will
> place where two lines meet." - s/that that/that/
> "A join exists at any point in a subpath shared by two consecutive pairs
> of lines." - should be "two consecutive lines" or "a consecutive pair of
> "In addition to the point where the join occurs, two additional points
> are relevant to each join: the corners found half the line width away
> from the join point, perpendicular to the two lines joining at the join
> point." - I'm not sure what that means. Nothing can be perpendicular to
> both of the two lines (unless they're parallel). For each line, there
> are the two corners half the line width away from the join point
> perpendicular to that line, but that gives four corners in total.
I've tried to explain it better. Let me know if it's not ok.
> "A filled triangle connecting ... with the third point of the triangle
> being the point of the join itself (where the lines touch on the inside
> of the join), must be rendered at all joins." - the "inside of the join"
> bit seems unhelpful and unclear (since it's not the opposite of the
> "outside of the join") - it'd be better just to say "... being the join
> point, must be ...", since that's the term used earlier for that point.
That simplification is a great idea. Done.
> "The round value means that a filled arc connecting the two corners on
> the outside of the join, with the diameter equal to the line width and
> the origin at the point of the join, must be rendered at joins." - if I
> was being pedantic (which I am) I'd say there's two possible arcs
> connecting those two corners (one clockwise, one anticlockwise), so it
> should specify which one is meant. But I don't know how to easily say
> that, and an implementor would have to be silly to do it the wrong way,
> so maybe a precise definition isn't needed.
I have tried to out-pedanticise you.
> Should lineJoin='round';moveTo(0,0);lineTo(100,0);lineTo(0,0);stroke()
> draw a semicircle at (100,0) pointing rightwards? There is no "outside
> of the join" there, so the spec doesn't say what should happen.
> "The miter value means that a filled four-sided polygon must be rendered
> at the join, with two of the lines being the perpendicular edges of the
> joining lines, ..." - the miter-polygon lines aren't the perpendicular
> edges - they're only half of each edge (between the join point and the
> outside corners). It's probably easier to define the polygon's points
> (being the join point, the two outside corners, and the point where the
> two continuated outside edges intersect).
I've tried redefining this using a triangle.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg