There were bugs, created yesterday, and there is still one. (I hope only one :) )
authorhegyi
Fri, 22 Jul 2005 11:04:27 +0000
changeset 15819bb83c7f479b
parent 1580 a9e4208cf4e3
child 1582 5fd89def7cbc
There were bugs, created yesterday, and there is still one. (I hope only one :) )
gui/all_include.h
gui/graph_displayer_canvas-edge.cc
gui/graph_displayer_canvas-node.cc
gui/graph_displayer_canvas.cc
gui/graphocska.lgf
     1.1 --- a/gui/all_include.h	Fri Jul 22 09:41:20 2005 +0000
     1.2 +++ b/gui/all_include.h	Fri Jul 22 11:04:27 2005 +0000
     1.3 @@ -22,7 +22,7 @@
     1.4  #define RANGE 3
     1.5  #define WIN_WIDTH 900
     1.6  #define WIN_HEIGHT 600
     1.7 -
     1.8 +#define ALMOST_ONE 0.99999999999999
     1.9  
    1.10  #ifndef MAIN_PART
    1.11  extern std::vector <std::string> edge_property_strings;
     2.1 --- a/gui/graph_displayer_canvas-edge.cc	Fri Jul 22 09:41:20 2005 +0000
     2.2 +++ b/gui/graph_displayer_canvas-edge.cc	Fri Jul 22 11:04:27 2005 +0000
     2.3 @@ -136,6 +136,10 @@
     2.4  		{
     2.5  		  if(j!=length)
     2.6  		    {
     2.7 +		      if((number-(int)number)>ALMOST_ONE)
     2.8 +			{
     2.9 +			  number=round(number);
    2.10 +			}
    2.11  		      int digit=(int)(number/maxpos);
    2.12  		      str[j]=(digit+'0');
    2.13  		      number-=digit*maxpos;
    2.14 @@ -174,6 +178,10 @@
    2.15  	    {
    2.16  	      if(j!=length)
    2.17  		{
    2.18 +		  if((number-(int)number)>ALMOST_ONE)
    2.19 +		    {
    2.20 +		      number=round(number);
    2.21 +		    }
    2.22  		  int digit=(int)(number/maxpos);
    2.23  		  str[j]=(digit+'0');
    2.24  		  number-=digit*maxpos;
     3.1 --- a/gui/graph_displayer_canvas-node.cc	Fri Jul 22 09:41:20 2005 +0000
     3.2 +++ b/gui/graph_displayer_canvas-node.cc	Fri Jul 22 11:04:27 2005 +0000
     3.3 @@ -135,7 +135,7 @@
     3.4    //in that case empty string will be written, because
     3.5    //that is the deleter map
     3.6  
     3.7 -  Graph::NodeMap<double> * actual_map;
     3.8 +  Graph::NodeMap<double> * actual_map=NULL;
     3.9    if(mapname!="Default")
    3.10      {
    3.11        actual_map=(mapstorage.nodemap_storage)[mapname];
    3.12 @@ -165,7 +165,14 @@
    3.13  		{
    3.14  		  if(j!=length)
    3.15  		    {
    3.16 - 		      int digit=(int)round(number/maxpos);
    3.17 +//  		      std::cout << (number) << "-" << (int)number << "=" << (number)-(int)number << std::endl;
    3.18 +		      if((number-(int)number)>ALMOST_ONE)
    3.19 +			{
    3.20 +// 			  std::cout<<"rounding: " <<number<<std::endl;
    3.21 +			  number=round(number);
    3.22 +			}
    3.23 + 		      int digit=(int)(number/maxpos);
    3.24 +// 		      std::cout << number << "/" << maxpos << "=" << digit << std::endl;
    3.25  		      str[j]=(digit+'0');
    3.26  		      number-=digit*maxpos;
    3.27  		      number*=10;
    3.28 @@ -202,6 +209,10 @@
    3.29  	    {
    3.30  	      if(j!=length)
    3.31  		{
    3.32 +		  if((number-(int)number)>ALMOST_ONE)
    3.33 +		    {
    3.34 +		      number=round(number);
    3.35 +		    }
    3.36  		  int digit=(int)(number/maxpos);
    3.37  		  str[j]=(digit+'0');
    3.38  		  number-=digit*maxpos;
     4.1 --- a/gui/graph_displayer_canvas.cc	Fri Jul 22 09:41:20 2005 +0000
     4.2 +++ b/gui/graph_displayer_canvas.cc	Fri Jul 22 11:04:27 2005 +0000
     4.3 @@ -2,7 +2,7 @@
     4.4  #include <broken_edge.h>
     4.5  #include <math.h>
     4.6  
     4.7 -GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),canvasentrywidget(NULL),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),edgemap_to_edit(""),nodemap_to_edit(""),mapwin(mw)
     4.8 +GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),canvasentrywidget(NULL),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),nodemap_to_edit(""),edgemap_to_edit(""),mapwin(mw)
     4.9  {
    4.10    
    4.11    
     5.1 --- a/gui/graphocska.lgf	Fri Jul 22 09:41:20 2005 +0000
     5.2 +++ b/gui/graphocska.lgf	Fri Jul 22 11:04:27 2005 +0000
     5.3 @@ -1,20 +1,20 @@
     5.4  @nodeset
     5.5  id	coordinates_x	coordinates_y data
     5.6  1	230	-80	1.123
     5.7 -2	230	100	3
     5.8 -3	120	-80	5
     5.9 -4	120	100	7
    5.10 -5	20	100	9
    5.11 -6	20	-80	11
    5.12 -7	-40	10	13
    5.13 -8	-100	100	15
    5.14 -9	-100	10	17
    5.15 -10	-100	-80	19
    5.16 -11	-200	-80	21
    5.17 -12	-200	10	23
    5.18 -13	-200	100	25
    5.19 -14	-300	100	27
    5.20 -15	-300	-80	29
    5.21 +2	230	100	3.234
    5.22 +3	120	-80	5.345
    5.23 +4	120	100	7.456
    5.24 +5	20	100	9.567
    5.25 +6	20	-80	11.678
    5.26 +7	-40	10	13.789
    5.27 +8	-100	100	15.890
    5.28 +9	-100	10	17.901
    5.29 +10	-100	-80	19.012
    5.30 +11	-200	-80	21.000
    5.31 +12	-200	10	23.001
    5.32 +13	-200	100	25.003
    5.33 +14	-300	100	27.004
    5.34 +15	-300	-80	29.9999
    5.35  
    5.36  @edgeset
    5.37  	        cap	map1	map2	map3	map4