From dd3076a51d8a53223c771a39fa5f976db0c85af5 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 14 Jan 2010 09:42:20 +0100 Subject: Implement segment weld to make segment join similar to node join (bzr r8846.2.12) --- src/ui/tool/multi-path-manipulator.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/ui/tool/multi-path-manipulator.cpp') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 2cc9bc97b..3ae7e4d24 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -304,15 +304,10 @@ void MultiPathManipulator::deleteNodes(bool keep_shape) } /** Join selected endpoints to create segments. */ -void MultiPathManipulator::joinSegment() +void MultiPathManipulator::joinSegments() { IterPairList joins; find_join_iterators(_selection, joins); - if (joins.empty()) { - _desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, - _("There must be at least 2 endnodes in selection")); - return; - } for (IterPairList::iterator i = joins.begin(); i != joins.end(); ++i) { bool same_path = prepare_join(*i); @@ -328,6 +323,9 @@ void MultiPathManipulator::joinSegment() } } + if (joins.empty()) { + invokeForAll(&PathManipulator::weldSegments); + } _doneWithCleanup("Join segments"); } @@ -421,7 +419,7 @@ bool MultiPathManipulator::event(GdkEvent *event) return true; } if (held_only_alt(event->key)) { - joinSegment(); + joinSegments(); return true; } break; -- cgit v1.2.3