
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.
Jasper: I see that you've wrote the PathString class that writes SVG path strings in Inkscape (in svg/path-string.cpp). Can you modify it so that if the last segment of a path is not linear, it is always written in absolute coordinates regardless of the preference settings? Otherwise we sometimes suffer from a loss of precision when writing the transformed path, which (I believe) causes the "rotate adds node" bug.
This sounds suspect. No loss of precision should ever add (or remove) a node. If it does there is something wrong (the number of nodes is completely unrelated to the position of the nodes).
For nodes in the middle of the path this is true, but not in the special case of the node that joins the beginning and end of the path. Whether we show one or two nodes between the first and last "real" segment directly depends on whether the closing segment introduced by "z" is zero-length or not. When a transformation makes the zero length closing segment non-zero, because the errors in relative coordinates add up differently, the node tool treats it as a real segment and no longer ignores it by showing only one node. So two nodes appear for both ends of the closing segment, while there should be only one. The loss of precision is a direct cause of the extra node bug. See the "7nodes" spreadsheet that was posted as the 2nd comment to the bug. https://bugs.launchpad.net/inkscape/+bug/515237
Regards, Krzysztof