[GRASS-SVN] r46386 - grass/branches/releasebranch_6_4/display/d.legend

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 23 08:27:25 EDT 2011


Author: hamish
Date: 2011-05-23 05:27:25 -0700 (Mon, 23 May 2011)
New Revision: 46386

Modified:
   grass/branches/releasebranch_6_4/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; merge from devbr6 r45627)


Modified: grass/branches/releasebranch_6_4/display/d.legend/main.c
===================================================================
--- grass/branches/releasebranch_6_4/display/d.legend/main.c	2011-05-23 12:11:48 UTC (rev 46385)
+++ grass/branches/releasebranch_6_4/display/d.legend/main.c	2011-05-23 12:27:25 UTC (rev 46386)
@@ -876,10 +876,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]);
+		}
 	    }
 
 	    R_move_abs((l + 3 + dots_per_line), (cur_dot_row) - 3);



More information about the grass-commit mailing list