W3C home > Mailing lists > Public > www-svg@w3.org > April 2010

Re: Question about stroke-linecap="square" and zero-length paths

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Wed, 21 Apr 2010 12:06:18 +0200
To: www-svg@w3.org, codedread@gmail.com
Message-Id: <201004211206.18407.Dr.O.Hoffmann@gmx.de>

this is explained in SVG 1.1 in F.5
(and whatever is added in the draft for the second edition, it should be 
consistent with the normative appendix, therefore the behaviour is not new
in SVGT1.2 or this draft ;o)
In SVGT1.2 it is in C.6

For this you have to determine the directionality of a subpath (what I learned 
some time ago by fixing a test from the test suite - not sure however, that 
the fix was ever updated in the T1.2 test suite ;o). 
If it has no directionality,  the square is aligned in the local x-direction.
Do you think, the viewer has another chance to get a directionality? 
(Of course it has, if there are other suppaths before or after this, but this
is not defined in the implementation requirements).

For several applications this is somehow inconvenient for authors of course,
but they can work around the problem by providing subpaths with a very
small length to indicate the direction.

For stroke-linejoin and marker one might need some directionality 
information as well - as defined in these appendices. For some
paths (or at least their canonical parametrisations)  it is not straight
forward to get the direction, for example if there is a coincidence of 
points and control points, however most of them still have one, 
as long as the length of the subpath is not really zero.

I found a path with a requirement for a stroke-linejoin in the middle of the 
subpath, just because there is a cusp/corner - 
"‘stroke-linejoin’ specifies the shape to be used at the corners of paths or
basic shapes when they are stroked."
This creates some more fun with implementations: 
d="M75,300c400,100 0,100 400,0"
According to the method of De Casteljau it must have always the same
appearence as for example: 
d="M75,300c200,50 200,75 200,75c0,0 0,-25 200,-75"
Guess what you get with many implementations? ;o)
Received on Wednesday, 21 April 2010 10:36:03 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:20 UTC