Changeset 1595:3bde58e2d5ca in lemon0.x
 Timestamp:
 07/27/05 13:02:51 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2099
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

gui/graph_displayer_canvasedge.cc
r1589 r1595 120 120 edgemap_to_edit=mapname; 121 121 double number=(*(mapstorage.edgemap_storage)[mapname])[i]; 122 int length=1;123 //if number is smaller than one, length would be negative, or invalid124 if(number>=1)125 {126 length=(int)(floor(log(number)/log(10)))+1;127 }128 int maxpos=(int)(pow(10,length1));129 int strl=length+1+RANGE;130 char * str=new char[strl];131 str[length]='.';132 str[strl]='\0';122 // int length=1; 123 // //if number is smaller than one, length would be negative, or invalid 124 // if(number>=1) 125 // { 126 // length=(int)(floor(log(number)/log(10)))+1; 127 // } 128 // int maxpos=(int)(pow(10,length1)); 129 // int strl=length+1+RANGE; 130 // char * str=new char[strl]; 131 // str[length]='.'; 132 // str[strl]='\0'; 133 133 134 for(int j=0;j<strl;j++) 135 { 136 if(j!=length) 137 { 138 if((number(int)number)>ALMOST_ONE) 139 { 140 number=round(number); 141 } 142 int digit=(int)(number/maxpos); 143 str[j]=(digit+'0'); 144 number=digit*maxpos; 145 number*=10; 146 } 147 } 148 149 edgetextmap[i]>property_text().set_value(str); 134 // for(int j=0;j<strl;j++) 135 // { 136 // if(j!=length) 137 // { 138 // if((number(int)number)>ALMOST_ONE) 139 // { 140 // number=round(number); 141 // } 142 // int digit=(int)(number/maxpos); 143 // str[j]=(digit+'0'); 144 // number=digit*maxpos; 145 // number*=10; 146 // } 147 // } 148 // edgetextmap[i]>property_text().set_value(str); 149 150 std::ostringstream ostr; 151 ostr << number; 152 153 edgetextmap[i]>property_text().set_value(ostr.str()); 150 154 } 151 155 else
Note: See TracChangeset
for help on using the changeset viewer.