summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/path-manipulator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2013-10-02 01:28:57 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2013-10-02 01:28:57 +0000
commit31c244b7e2d06d67d67142696351507b1a08bb09 (patch)
treec50139a9bcb8b5a5fb9e422e3972a41ad068436f /src/ui/tool/path-manipulator.cpp
parentFix outfocus gradients. Fixes a regression from 0.48 in the SVG test suite (diff)
downloadinkscape-31c244b7e2d06d67d67142696351507b1a08bb09.tar.gz
inkscape-31c244b7e2d06d67d67142696351507b1a08bb09.zip
Fix segment welding in the node tool hanging when a two-point segment
and at least one additional point is selected. Fixes LP bug #710101. Fixed bugs: - https://launchpad.net/bugs/710101 (bzr r12650)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 6e14e8e97..b775c0637 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -459,7 +459,10 @@ void PathManipulator::weldSegments()
if (j->selected()) ++num_selected;
else ++num_unselected;
}
- if (num_selected < 3) continue;
+
+ // if 2 or fewer nodes are selected, there can't be any middle points to remove.
+ if (num_selected <= 2) continue;
+
if (num_unselected == 0 && sp->closed()) {
// if all nodes in a closed subpath are selected, the operation doesn't make much sense
continue;
@@ -489,14 +492,16 @@ void PathManipulator::weldSegments()
}
if (num_points > 2) {
// remove nodes in the middle
+ // TODO: fit bezier to the former shape
sel_beg = sel_beg.next();
while (sel_beg != sel_end.prev()) {
NodeList::iterator next = sel_beg.next();
sp->erase(sel_beg);
sel_beg = next;
}
- sel_beg = sel_end;
}
+ sel_beg = sel_end;
+ // decrease num_selected by the number of points processed
num_selected -= num_points;
}
}