[svgwg] Possible error in ordering of rules in section SVG2 13.5.7 (#771)

skef has just created a new issue for https://github.com/w3c/svgwg:

== Possible error in ordering of rules in section SVG2 13.5.7  ==
This is in reference to section [13.5.7](https://svgwg.org/svg2-draft/painting.html#StrokeShape) of the current SVG 2 draft.

In the sub-section of 13.5.7 that starts with "The line join shape for a given segment of a subpath ...", number 10 starts:

> If stroke-linejoin is **arcs**, then find the circles that are tangent to the stroke edges at P1 and P2 with the same curvature as the edges at those points (see below). If both curvatures are zero fall through to miter-clip. If either curvature is greater than 2/(stroke width), fallback to **round**. Extend the stroke edges using these circles (or a line, in the case of zero curvature). If the two circles (or circle and line) do not intersect, adjust the radii of the two circles by an equal amount (or just the circle in case of a circle and line) until they do intersect (see below). 

After playing around with this I worry this is the wrong place to apply the round fallback. In my (current) opinion the order should be:

1. Use the "raw" curvatures for the miter-clip fallback test. 
2. If the circles or circle/line do not intersect, correct the radius/radii according to section 13.5.9
3. Use the adjusted curvatures (or, probably more conveniently, radii) for the round fallback test.

Otherwise the round fallback test seems too aggressive. 

A side note: A later part of section 13.5.9 describes how to construct a rectangle when the tangent offsets are parallel. In my opinion it would be more compact to add this condition miter-clip fallback toward the start of number 10 quoted above. (As in: "If both curvatures are zero or the tangents of the offset paths are parallel fall through to miter-clip". On my reading, at least, a correct miter-clip implementation will produce the desired rectangle.) 

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/771 using your GitHub account

Received on Wednesday, 8 January 2020 21:39:38 UTC