[GRASS-SVN] r45626 - grass/trunk/display/d.legend
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 10 23:57:27 EST 2011
Author: hamish
Date: 2011-03-10 20:57:27 -0800 (Thu, 10 Mar 2011)
New Revision: 45626
Modified:
grass/trunk/display/d.legend/main.c
Log:
Dylan: pass through format exactly as given by the user in the use= command line parameter, helps with log scale. (#1147)
Modified: grass/trunk/display/d.legend/main.c
===================================================================
--- grass/trunk/display/d.legend/main.c 2011-03-11 04:19:17 UTC (rev 45625)
+++ grass/trunk/display/d.legend/main.c 2011-03-11 04:57:27 UTC (rev 45626)
@@ -858,10 +858,21 @@
sprintf(buff + strlen(buff), " %s", cstr);
}
else { /* is fp */
- if (!flip)
- sprintf(buff, DispFormat, catlist[i]);
- else
- sprintf(buff, DispFormat, catlist[catlistCount - i - 1]);
+ if (!flip) {
+ if(use_catlist)
+ /* pass through format exactly as given by the user in
+ the use= command line parameter (helps with log scale) */
+ sprintf(buff, "%s", opt8->answers[i]);
+ else
+ /* automatically generated/tuned decimal precision format */
+ sprintf(buff, DispFormat, catlist[i]);
+ }
+ else {
+ if(use_catlist)
+ sprintf(buff, "%s", opt8->answers[catlistCount - i - 1]);
+ else
+ sprintf(buff, DispFormat, catlist[catlistCount - i - 1]);
+ }
}
D_pos_abs((l + 3 + dots_per_line), (cur_dot_row) - 3);
More information about the grass-commit
mailing list