On 26/10/2010, at 6:47 PM, ~suv wrote:
Any chance you could take a look at another regression? Bug #591586 “[connectors] 'z' segments closing a path are ignored” https://bugs.launchpad.net/inkscape/+bug/591586
Due to changes how the closing segment (z) is stored in the path data in 0.48, connectors ignore the closing segment of paths and shapes if it is a straight line (still present in r9854 and the 0.48.x branch).
This appears to be a problem with 2geom's path crossing-detection code. Basically, the crossing detection code seems to be ignoring the final line segment of closed paths. As far as I could understand the 2geom code, this is possibly due to the bounds() function in 2geom/crossing.h using Path::size() which will be equivalent to Path::size_open() rather than Path::size_default() (which calls Path::size_closed() for closed paths).
Could familiar with 2geom's crossing detection code, or Krzysztof (who authored the closing segment changes), please have a look into this problem and find the correct way to fix it? The bug report above shows the symptoms.
All the connector code is doing is finding the crossings between the pathvector for the connector and the attached shape: SPCurve* shape_curve = sp_shape_get_curve(SP_SHAPE(item)); // apply transformations (up to common ancestor) shape_curve->transform(item_transform); const Geom::PathVector& shape_pv = shape_curve->get_pathvector(); Geom::CrossingSet cross = crossings(conn_pv, shape_pv);
In this case shape_pv generated from a rectangle object contains a single closed path with a segment count of 4, but crossings with the final (closing) segment of the path are not detected by 2geom.
Cheers, Michael