diff -r 739df601808d -r c2f95eac652b gui/graph_displayer_canvas-edge.cc --- a/gui/graph_displayer_canvas-edge.cc Thu Jul 28 14:31:32 2005 +0000 +++ b/gui/graph_displayer_canvas-edge.cc Thu Jul 28 15:54:00 2005 +0000 @@ -6,12 +6,18 @@ int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge) { Graph::EdgeMap * actual_map; + double min, max; + if(mapname=="Default") { + min=edge_property_defaults[E_WIDTH]; + max=edge_property_defaults[E_WIDTH]; actual_map=new Graph::EdgeMap(g,edge_property_defaults[E_WIDTH]); } else { + min=mapstorage.minOfEdgeMap(mapname); + max=mapstorage.maxOfEdgeMap(mapname); actual_map=(mapstorage.edgemap_storage)[mapname]; } @@ -19,11 +25,17 @@ { for (EdgeIt i(g); i!=INVALID; ++i) { - int w=(int)(*actual_map)[i]; - if(w>=0) + double v=abs((*actual_map)[i]); + int w; + if(min==max) { - edgesmap[i]->property_width_units().set_value(w); + w=(int)(edge_property_defaults[E_WIDTH]); } + else + { + w=(int)(MIN_EDGE_WIDTH+(v-min)/(max-min)*(MAX_EDGE_WIDTH-MIN_EDGE_WIDTH)); + } + edgesmap[i]->property_width_units().set_value(w); } } else