equal
deleted
inserted
replaced
1 #include "graph_displayer_canvas.h" |
1 #include "graph_displayer_canvas.h" |
2 #include <cmath> |
2 #include <cmath> |
3 |
3 |
4 const int minimum_node_radius=0; |
4 const int minimum_node_radius=5; |
5 |
5 |
6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node) |
6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node) |
7 { |
7 { |
8 Graph::NodeMap<double> * actual_map; |
8 Graph::NodeMap<double> * actual_map; |
9 double min, max; |
9 double min, max; |
23 { |
23 { |
24 w=(int)(node_property_defaults[N_RADIUS]); |
24 w=(int)(node_property_defaults[N_RADIUS]); |
25 } |
25 } |
26 else |
26 else |
27 { |
27 { |
28 w=(int)(minimum_node_radius+(v-min)/(max-min)*(radius_max-minimum_node_radius)); |
28 w=(int)(minimum_node_radius+(v-min)/(max-min)*(radius_size-minimum_node_radius)); |
29 } |
29 } |
30 } |
30 } |
31 else |
31 else |
32 { |
32 { |
33 w=(int)(v*radius_max); |
33 w=(int)(v*radius_size); |
34 } |
34 } |
35 |
35 |
36 if(w<5) |
36 if(w<minimum_node_radius) |
37 { |
37 { |
38 w=5; |
38 w=minimum_node_radius; |
39 } |
39 } |
40 |
40 |
41 if(zoomtrack) |
41 if(zoomtrack) |
42 { |
42 { |
43 double actual_ppu=get_pixels_per_unit(); |
43 double actual_ppu=get_pixels_per_unit(); |