diff -r d99e115d0d26 -r d79a71382836 graph_displayer_canvas-event.cc --- a/graph_displayer_canvas-event.cc Mon Sep 25 10:18:35 2006 +0000 +++ b/graph_displayer_canvas-event.cc Mon Sep 25 12:08:35 2006 +0000 @@ -169,46 +169,57 @@ //all the edges connected to the moved point has to be redrawn for(OutEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei) { + XY arrow_pos; + + if (mytab.mapstorage.graph.source(ei) == mytab.mapstorage.graph.target(ei)) + { + arrow_pos = mytab.mapstorage.arrow_pos[ei] + XY(dx, dy); + } + else + { XY moved_node_1(coord_x - dx, coord_y - dy); XY moved_node_2(coord_x, coord_y); Node target = mytab.mapstorage.graph.target(ei); XY fix_node(mytab.mapstorage.coords[target].x, - mytab.mapstorage.coords[target].y); + mytab.mapstorage.coords[target].y); + XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]); + + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); + } + + mytab.mapstorage.arrow_pos.set(ei, arrow_pos); + edgesmap[ei]->draw(); + + //reposition of edgetext + XY text_pos=mytab.mapstorage.arrow_pos[ei]; + text_pos+=(XY(10,10)); + edgetextmap[ei]->property_x().set_value(text_pos.x); + edgetextmap[ei]->property_y().set_value(text_pos.y); + } + + for(InEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei) + { + if (mytab.mapstorage.graph.source(ei) != mytab.mapstorage.graph.target(ei)) + { + XY moved_node_1(coord_x - dx, coord_y - dy); + XY moved_node_2(coord_x, coord_y); + Node source = mytab.mapstorage.graph.source(ei); + XY fix_node(mytab.mapstorage.coords[source].x, + mytab.mapstorage.coords[source].y); XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]); XY arrow_pos; - arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); mytab.mapstorage.arrow_pos.set(ei, arrow_pos); edgesmap[ei]->draw(); - //reposition of edgetext - XY text_pos=mytab.mapstorage.arrow_pos[ei]; - text_pos+=(XY(10,10)); - edgetextmap[ei]->property_x().set_value(text_pos.x); - edgetextmap[ei]->property_y().set_value(text_pos.y); - } - - for(InEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei) - { - XY moved_node_1(coord_x - dx, coord_y - dy); - XY moved_node_2(coord_x, coord_y); - Node source = mytab.mapstorage.graph.source(ei); - XY fix_node(mytab.mapstorage.coords[source].x, - mytab.mapstorage.coords[source].y); - XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]); - - XY arrow_pos; - arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); - - mytab.mapstorage.arrow_pos.set(ei, arrow_pos); - edgesmap[ei]->draw(); - - //reposition of edgetext - XY text_pos=mytab.mapstorage.arrow_pos[ei]; - text_pos+=(XY(10,10)); - edgetextmap[ei]->property_x().set_value(text_pos.x); - edgetextmap[ei]->property_y().set_value(text_pos.y); + //reposition of edgetext + XY text_pos=mytab.mapstorage.arrow_pos[ei]; + text_pos+=(XY(10,10)); + edgetextmap[ei]->property_x().set_value(text_pos.x); + edgetextmap[ei]->property_y().set_value(text_pos.y); + } } } default: break; @@ -526,7 +537,7 @@ { for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) { - if(edgesmap[i]==active_item) + if(edgesmap[i]->getLine()==active_item) { active_edge=i; }