J.B.C.Engelen@...1578... wrote:
-----Original Message-----
== Line segment without moveto after closing path == C: "M x1,y1 ... z L x2,y2" D: "M x1,y1 ... z M x1,y1 L x2,y2" These paths are also not identical.
Hm. That's an interesting problem. So in C they were actually treated as a continuous path rather than separate subpaths? Are you certain that the old behavior was correct?
AFAIK Inkscape 0.46 cannot distinguish these paths and always writes D back to SVG. I haven't checked what C should mean according to SVG spec. Jasper mentioned to me that they are different, therefore I suspected that curve C should be one continuous path; I haven't thought of another way in which they can be different. Luckily, Inkscape cannot create the C kind of path. And it seems a pretty obscure path anyhow. Don't know if it occurs in the SVG test suite, or perhaps Jasper was being real smart! :) I think it would not be a small change to 2geom's logic to be able to represent this kind of path (and distinguish it from 'normal' way of writing the continuous path).
To clarify, I found the following in the specification: ------------------------------ When a 'closepath' command is followed by a command other than a 'moveto' command, then the orientation of the marker corresponding to the 'closepath' command is calculated assuming that: - the path segment going into the vertex is the path segment corresponding to the closepath - the path segment coming out of the vertex is the first path segment of the subsequent subpath ------------------------------ See: http://www.w3.org/TR/SVG11/painting.html#OrientAttribute
Also see testcases/basic/marker.svg in the rendering tests in SVN. I tried rendering it with Batik as well, and it does indeed make a difference (whether or not the M is there), although Batik does get the orientation wrong as far as I can tell (it looks like it reverses the segments or something, the arrow is rotated exactly 180 degrees compared to what I would expect).