summaryrefslogtreecommitdiffstats
path: root/src/conn-avoid-ref.cpp
diff options
context:
space:
mode:
authorMichael Wybrow <michael.wybrow@monash.edu>2010-10-26 02:00:27 +0000
committerMichael Wybrow <mjwybrow@users.sf.net>2010-10-26 02:00:27 +0000
commit615d2d4cb62ce4ec120b7d5aaa5091ef8a636e4c (patch)
tree82eda9a4c4ddbce53273d171bd2afab536c2e251 /src/conn-avoid-ref.cpp
parentDutch translation and pot update (diff)
downloadinkscape-615d2d4cb62ce4ec120b7d5aaa5091ef8a636e4c.tar.gz
inkscape-615d2d4cb62ce4ec120b7d5aaa5091ef8a636e4c.zip
Fix bug #666586: Connector routing regression
Fixed bugs: - https://launchpad.net/bugs/666586 (bzr r9853.1.1)
Diffstat (limited to '')
-rw-r--r--src/conn-avoid-ref.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index a918f8745..fe25fa418 100644
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -28,6 +28,7 @@
#include "libavoid/router.h"
#include "libavoid/connector.h"
#include "libavoid/geomtypes.h"
+#include "libavoid/shape.h"
#include "xml/node.h"
#include "document.h"
#include "desktop.h"
@@ -389,8 +390,6 @@ Geom::Point SPAvoidRef::getConnectionPointPos(const int type, const int id)
g_assert(item);
Geom::Point pos;
const Geom::Matrix& transform = sp_item_i2doc_affine(item);
- // TODO investigate why this was asking for the active desktop:
- SPDesktop *desktop = inkscape_active_desktop();
if ( type == ConnPointDefault )
{
@@ -447,6 +446,12 @@ static std::vector<Geom::Point> approxCurveWithPoints(SPCurve *curve)
{
Geom::Path::const_iterator cit = pit->begin();
while (cit != pit->end())
+ {
+ if (cit == pit->begin())
+ {
+ poly_points.push_back(cit->initialPoint());
+ }
+
if (dynamic_cast<Geom::CubicBezier const*>(&*cit))
{
at += seg_size;
@@ -463,6 +468,7 @@ static std::vector<Geom::Point> approxCurveWithPoints(SPCurve *curve)
poly_points.push_back(cit->finalPoint());
++cit;
}
+ }
++pit;
}
return poly_points;
@@ -521,7 +527,7 @@ static Avoid::Polygon avoid_item_poly(SPItem const *item)
prev_parallel_hull_edge.origin(hull_edge.origin()+hull_edge.versor().ccw()*spacing);
prev_parallel_hull_edge.versor(hull_edge.versor());
int hull_size = hull.boundary.size();
- for (int i = 0; i <= hull_size; ++i)
+ for (int i = 0; i < hull_size; ++i)
{
hull_edge.setBy2Points(hull[i], hull[i+1]);
Geom::Line parallel_hull_edge;