diff -r 013afe9ee040 -r b465e2c34f23 graph_displayer_canvas.cc --- a/graph_displayer_canvas.cc Wed Jan 10 14:56:16 2007 +0000 +++ b/graph_displayer_canvas.cc Fri Feb 02 10:13:33 2007 +0000 @@ -28,10 +28,14 @@ was_redesigned(false), is_drawn(false), mytab(mainw), background_set(false) { + //add mouse scroll event handler - it won't be changed, it handles zoom + signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::scrollEventHandler), false); + //base event handler is move tool actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); actual_tool=MOVE; + active_node=INVALID; active_edge=INVALID; forming_edge=INVALID; @@ -319,6 +323,7 @@ void GraphDisplayerCanvas::reDesignGraph() { + double max_coord=50000; double min_dist=20; double init_vector_length=25; @@ -401,6 +406,26 @@ } for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) { + if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x>max_coord) + { + actual_forces[i].x=max_coord-((mytab.mapstorage).coords[i].x); + std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; + } + else if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x<(0-max_coord)) + { + actual_forces[i].x=0-max_coord-((mytab.mapstorage).coords[i].x); + std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; + } + if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y>max_coord) + { + actual_forces[i].y=max_coord-((mytab.mapstorage).coords[i].y); + std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; + } + else if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y<(0-max_coord)) + { + actual_forces[i].y=0-max_coord-((mytab.mapstorage).coords[i].y); + std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; + } moveNode(actual_forces[i].x, actual_forces[i].y, nodesmap[i], i); } }