gui/graph_displayer_canvas-edge.cc
changeset 1595 3bde58e2d5ca
parent 1589 9192e1b26d32
child 1596 44897b1ba4e2
     1.1 --- a/gui/graph_displayer_canvas-edge.cc	Wed Jul 27 10:47:38 2005 +0000
     1.2 +++ b/gui/graph_displayer_canvas-edge.cc	Wed Jul 27 11:02:51 2005 +0000
     1.3 @@ -119,34 +119,38 @@
     1.4  	    {
     1.5  	      edgemap_to_edit=mapname;
     1.6  	      double number=(*(mapstorage.edgemap_storage)[mapname])[i];
     1.7 -	      int length=1;
     1.8 -	      //if number is smaller than one, length would be negative, or invalid
     1.9 -	      if(number>=1)
    1.10 -		{
    1.11 -		  length=(int)(floor(log(number)/log(10)))+1;
    1.12 -		}
    1.13 -	      int maxpos=(int)(pow(10,length-1));
    1.14 -	      int strl=length+1+RANGE;
    1.15 -	      char * str=new char[strl];
    1.16 -	      str[length]='.';
    1.17 -	      str[strl]='\0';
    1.18 +// 	      int length=1;
    1.19 +// 	      //if number is smaller than one, length would be negative, or invalid
    1.20 +// 	      if(number>=1)
    1.21 +// 		{
    1.22 +// 		  length=(int)(floor(log(number)/log(10)))+1;
    1.23 +// 		}
    1.24 +// 	      int maxpos=(int)(pow(10,length-1));
    1.25 +// 	      int strl=length+1+RANGE;
    1.26 +// 	      char * str=new char[strl];
    1.27 +// 	      str[length]='.';
    1.28 +// 	      str[strl]='\0';
    1.29        
    1.30 -	      for(int j=0;j<strl;j++)
    1.31 -		{
    1.32 -		  if(j!=length)
    1.33 -		    {
    1.34 -		      if((number-(int)number)>ALMOST_ONE)
    1.35 -			{
    1.36 -			  number=round(number);
    1.37 -			}
    1.38 -		      int digit=(int)(number/maxpos);
    1.39 -		      str[j]=(digit+'0');
    1.40 -		      number-=digit*maxpos;
    1.41 -		      number*=10;
    1.42 -		    }
    1.43 -		}
    1.44 -      
    1.45 -	      edgetextmap[i]->property_text().set_value(str);
    1.46 +// 	      for(int j=0;j<strl;j++)
    1.47 +// 		{
    1.48 +// 		  if(j!=length)
    1.49 +// 		    {
    1.50 +// 		      if((number-(int)number)>ALMOST_ONE)
    1.51 +// 			{
    1.52 +// 			  number=round(number);
    1.53 +// 			}
    1.54 +// 		      int digit=(int)(number/maxpos);
    1.55 +// 		      str[j]=(digit+'0');
    1.56 +// 		      number-=digit*maxpos;
    1.57 +// 		      number*=10;
    1.58 +// 		    }
    1.59 +// 		}
    1.60 +//       	      edgetextmap[i]->property_text().set_value(str);
    1.61 +
    1.62 +	      std::ostringstream ostr;
    1.63 +	      ostr << number;
    1.64 +
    1.65 +      	      edgetextmap[i]->property_text().set_value(ostr.str());
    1.66  	    }
    1.67  	  else
    1.68  	    {