Changeset 187:b465e2c34f23 in glemon-0.x for graph_displayer_canvas.cc
- Timestamp:
- 02/02/07 11:13:33 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas.cc
r184 r187 29 29 background_set(false) 30 30 { 31 //add mouse scroll event handler - it won't be changed, it handles zoom 32 signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::scrollEventHandler), false); 33 31 34 //base event handler is move tool 32 35 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); 33 36 actual_tool=MOVE; 37 34 38 35 39 active_node=INVALID; … … 320 324 void GraphDisplayerCanvas::reDesignGraph() 321 325 { 326 double max_coord=50000; 322 327 double min_dist=20; 323 328 double init_vector_length=25; … … 402 407 for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) 403 408 { 409 if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x>max_coord) 410 { 411 actual_forces[i].x=max_coord-((mytab.mapstorage).coords[i].x); 412 std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; 413 } 414 else if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x<(0-max_coord)) 415 { 416 actual_forces[i].x=0-max_coord-((mytab.mapstorage).coords[i].x); 417 std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; 418 } 419 if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y>max_coord) 420 { 421 actual_forces[i].y=max_coord-((mytab.mapstorage).coords[i].y); 422 std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; 423 } 424 else if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y<(0-max_coord)) 425 { 426 actual_forces[i].y=0-max_coord-((mytab.mapstorage).coords[i].y); 427 std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; 428 } 404 429 moveNode(actual_forces[i].x, actual_forces[i].y, nodesmap[i], i); 405 430 }
Note: See TracChangeset
for help on using the changeset viewer.