[GRASS-SVN] r33394 - grass/branches/develbranch_6/ps/ps.map
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 10 22:38:59 EDT 2008
Author: hamish
Date: 2008-09-10 22:38:59 -0400 (Wed, 10 Sep 2008)
New Revision: 33394
Modified:
grass/branches/develbranch_6/ps/ps.map/ps_fclrtbl.c
Log:
second try at printing data unit labels with FP legends
Modified: grass/branches/develbranch_6/ps/ps.map/ps_fclrtbl.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/ps_fclrtbl.c 2008-09-11 02:12:00 UTC (rev 33393)
+++ grass/branches/develbranch_6/ps/ps.map/ps_fclrtbl.c 2008-09-11 02:38:59 UTC (rev 33394)
@@ -39,7 +39,7 @@
struct FPRange range;
double ex, cur_d, cur_ex;
int do_color;
- double grey_color_val;
+ double grey_color_val, margin;
int max_label_length = 0;
/* let user know what's happenning */
@@ -250,8 +250,14 @@
/* print units label, if present */
if (G_read_raster_units(ct.name, ct.mapset, units) != 0)
units[0] = '\0';
-/* not ready yet
+
+ /* TODO: nicer placement as label length changes; realign for tickbar mode */
if(strlen(units)) {
+ margin = 0.2 * fontsize;
+ if (margin < 2)
+ margin = 2;
+ fprintf(PS.fp, "/mg %.1f def\n", margin);
+
text_box_path( x2 + max_label_length*(fontsize*.7),
t - height/2,
LEFT, CENTER, units, fontsize, 0);
@@ -259,7 +265,6 @@
set_rgb_color(BLACK);
fprintf(PS.fp, "TIB\n");
}
-*/
G_free_colors(&colors);
More information about the grass-commit
mailing list