summaryrefslogtreecommitdiffstats
path: root/src/conn-avoid-ref.cpp
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-05-12 00:20:50 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-05-12 07:05:10 +0000
commit6a717e676375f36b59c068c92407da9922961865 (patch)
treea6d86ede5191e83d864c54885517c3e88cc0ee49 /src/conn-avoid-ref.cpp
parentlibcroco: fix 'if' statement missing curly brackets (diff)
downloadinkscape-6a717e676375f36b59c068c92407da9922961865.tar.gz
inkscape-6a717e676375f36b59c068c92407da9922961865.zip
Stop Connector tool avoidance crash in flatpak
Diffstat (limited to 'src/conn-avoid-ref.cpp')
-rw-r--r--src/conn-avoid-ref.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index aa7f91cad..3b706e151 100644
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -285,14 +285,18 @@ static Avoid::Polygon avoid_item_poly(SPItem const *item)
// store expanded convex hull in Avoid::Polygn
Avoid::Polygon poly;
- Geom::Line hull_edge(hull[-1], hull[0]);
+ Geom::Line hull_edge(hull.back(), hull.front());
Geom::Line prev_parallel_hull_edge;
prev_parallel_hull_edge.setOrigin(hull_edge.origin()+hull_edge.versor().ccw()*spacing);
prev_parallel_hull_edge.setVector(hull_edge.versor());
int hull_size = hull.size();
for (int i = 0; i < hull_size; ++i)
{
- hull_edge.setPoints(hull[i], hull[i+1]);
+ if (i + 1 == hull_size) {
+ hull_edge.setPoints(hull.back(), hull.front());
+ } else {
+ hull_edge.setPoints(hull[i], hull[i + 1]);
+ }
Geom::Line parallel_hull_edge;
parallel_hull_edge.setOrigin(hull_edge.origin()+hull_edge.versor().ccw()*spacing);
parallel_hull_edge.setVector(hull_edge.versor());