placement of the coordinates caption now takes into account the node radius
authorladanyi
Fri, 26 Aug 2005 15:30:01 +0000
changeset 16540917756ba533
parent 1653 9955e7ec7e89
child 1655 4a7b392e4fb0
placement of the coordinates caption now takes into account the node radius
gui/graph_displayer_canvas-event.cc
     1.1 --- a/gui/graph_displayer_canvas-event.cc	Fri Aug 26 15:06:51 2005 +0000
     1.2 +++ b/gui/graph_displayer_canvas-event.cc	Fri Aug 26 15:30:01 2005 +0000
     1.3 @@ -159,24 +159,26 @@
     1.4          ostr << "(" <<
     1.5            mapstorage.coords[active_node].x << ", " <<
     1.6            mapstorage.coords[active_node].y << ")";
     1.7 +        double radius =
     1.8 +          (nodesmap[active_node]->property_x2().get_value() -
     1.9 +          nodesmap[active_node]->property_x1().get_value()) / 2.0;
    1.10          if (coord_text)
    1.11          {
    1.12            coord_text->property_text().set_value(ostr.str());
    1.13            coord_text->property_x().set_value(mapstorage.coords[active_node].x +
    1.14 -              node_property_defaults[N_RADIUS] + 40);
    1.15 -          coord_text->property_y().set_value(mapstorage.coords[active_node].y +
    1.16 -              node_property_defaults[N_RADIUS] - 40);
    1.17 +              radius);
    1.18 +          coord_text->property_y().set_value(mapstorage.coords[active_node].y -
    1.19 +              radius);
    1.20          }
    1.21          else
    1.22          {
    1.23            coord_text = new Gnome::Canvas::Text(
    1.24                displayed_graph,
    1.25 -              mapstorage.coords[active_node].x +
    1.26 -              node_property_defaults[N_RADIUS] + 40,
    1.27 -              mapstorage.coords[active_node].y +
    1.28 -              node_property_defaults[N_RADIUS] - 40,
    1.29 +              mapstorage.coords[active_node].x + radius,
    1.30 +              mapstorage.coords[active_node].y - radius,
    1.31                ostr.str());
    1.32            coord_text->property_fill_color().set_value("black");
    1.33 +          coord_text->property_anchor().set_value(Gtk::ANCHOR_SOUTH_WEST);
    1.34          }
    1.35  
    1.36  	//all the edges connected to the moved point has to be redrawn