Krzysztof Kosiński wrote:
W dniu 11 lutego 2010 18:08 użytkownik Jasper van de Gronde <th.v.d.gronde@...528...> napisał:
Why would it simplify this? If it is present without the path being closed this makes sense (you'd indeed have to skip it), but for closed paths the segment is definitely there (even if zero length). Remember that in general a zero-length segment is simply valid SVG and the close-path command is defined as drawing a straight segment between the current point and the beginning of the subpath (whether this segment is zero-length or not).
The issue is not that this segment exists in open paths. It's a problem when the path's last "real" segment is a bezier, or an explicit line segment (l rather than z). When there's a zero-length closing segment in a closed path, I need to ignore it and only show one node for the join between the last segment and first segment, and the segment introduced by "z" has to be ignored.
The path "M 0,0 L 1,1 z" has two nodes and "M 0,0 L 1,1 L 0,0 z" has three. Inkscape definitely SHOULD distinguish the two. (The most obvious reason being that the first path should only have one mid marker and the second two.)
I understand this is stranger when the segments involved are curves, but that doesn't make it untrue. SVG simply does not have any way of specifying a closed path with only curved segments.
Relying on the numerical precision of Inkscape (and/or other applications) to give extra meaning to a zero-length segment connecting two (curved) segments if it happens to be the last segment in the current subpath is risky at best and could lead to very subtle and weird issues (as well as no round-tripping).
As for the correct fix, that's another story. The best fix would obviously have been to handle closed paths differently in SVG. More realistically we may want to make a special nodetype (as in sodipodi:nodetypes) that indicates that a node is intended to close the curve (whether or not the endpoint indeed coincides with the first node of the subpath). For example, we could use the capital version of the nodetype for this purpose.