From: Krzysztof KosiƄski Date: Sun, 31 Jan 2010 20:02:28 +0000 (+0100) Subject: Fix the position of joined nodes to match 0.47 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c190ec7f7a67afd75ca96133c859516c131319c5;p=inkscape.git Fix the position of joined nodes to match 0.47 --- 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);