diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-31 20:02:28 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-31 20:02:28 +0000 |
| commit | ec40d28e9f82da40d6efbb93ba6821e7e0976c42 (patch) | |
| tree | 0caf0e44d0cb7f4531c0a4869a5073d8444d81cb /src/ui | |
| parent | Add pref settings that control updating the display of paths when dragging (diff) | |
| download | inkscape-ec40d28e9f82da40d6efbb93ba6821e7e0976c42.tar.gz inkscape-ec40d28e9f82da40d6efbb93ba6821e7e0976c42.zip | |
Fix the position of joined nodes to match 0.47
Fixed bugs:
- https://launchpad.net/bugs/514516
(bzr r9039)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 734ddf15b..d133fcf25 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -241,36 +241,33 @@ void MultiPathManipulator::joinNodes() for (IterPairList::iterator i = joins.begin(); i != joins.end(); ++i) { bool same_path = prepare_join(*i); - bool mouseover = true; NodeList &sp_first = NodeList::get(i->first); NodeList &sp_second = NodeList::get(i->second); i->first->setType(NODE_CUSP, false); - Geom::Point joined_pos, pos_front, pos_back; - pos_front = *i->second->front(); - pos_back = *i->first->back(); + Geom::Point joined_pos, pos_handle_front, pos_handle_back; + pos_handle_front = *i->second->front(); + pos_handle_back = *i->first->back(); + + // When we encounter the mouseover node, we unset the iterator - it will be invalidated if (i->first == preserve_pos) { joined_pos = *i->first; + preserve_pos = NodeList::iterator(); } else if (i->second == preserve_pos) { joined_pos = *i->second; + preserve_pos = NodeList::iterator(); } else { - joined_pos = Geom::middle_point(pos_back, pos_front); - mouseover = false; + joined_pos = Geom::middle_point(*i->first, *i->second); } // if the handles aren't degenerate, don't move them i->first->move(joined_pos); Node *joined_node = i->first.ptr(); if (!i->second->front()->isDegenerate()) { - joined_node->front()->setPosition(pos_front); + joined_node->front()->setPosition(pos_handle_front); } if (!i->first->back()->isDegenerate()) { - joined_node->back()->setPosition(pos_back); - } - if (mouseover) { - // Second node could be mouseovered, but it will be deleted, so we must change - // the preserve_pos iterator to the first node. - preserve_pos = i->first; + joined_node->back()->setPosition(pos_handle_back); } sp_second.erase(i->second); |
