W dniu 10 lutego 2010 19:14 użytkownik Jasper van de Gronde <th.v.d.gronde@...528...> napisał:
If you're talking about having a closed path and then not adding the closing segment, please reconsider. Inkscape used to do this in the past and it caused some very nasty bugs (having to do with round-tripping for one), apart from simply being incorrect (at least in SVG).
Some background: currently paths always store a "closing segment" that is not part of the "normal" user supplied path data, but can be iterated over using end_closed. The intent is to have a well defined way to stroke and fill a path. This segment is stored even if it is degenerate (zero length), for example when the path is closed and has only Bezier curves.
After the proposed change the closing segment will not be added if the final point of the last segment of the "normal" path data is exactly equal to the initial point of the first segment. Closedness will still be stored in a flag, like before, and affect what is returned from the iterators. This will simplify the code in the node tool, because the path won't have a zero-length segment at the end that has to be intelligently skipped. By itself it probably won't fix the bug I mentioned, but it will simplify a quirk when dealing with closed paths.
Alternatively, the iterators might be modified so that iterating over the closed path doesn't return the extra zero-length segment, but then I see no need to store it in the first place. If there is some specific need to have this zero-length segment in the path, I will reconsider this.
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.
Regards, Krzysztof