[GRASS-SVN] r65945 - grass/branches/releasebranch_6_4/ps/ps.map

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 15 15:21:40 PDT 2015


Author: neteler
Date: 2015-08-15 15:21:40 -0700 (Sat, 15 Aug 2015)
New Revision: 65945

Modified:
   grass/branches/releasebranch_6_4/ps/ps.map/ps_vlegend.c
Log:
ps.map vlegend: bugfix: crazy y values for vpoints in vector legend as vector.layer[i].offset was being used uninitialized (offset and coffset are only used for parallel road feature of vlines). another approach might be to init them to 0 in ps.map/vector.h (backport, trunk r65928)

Modified: grass/branches/releasebranch_6_4/ps/ps.map/ps_vlegend.c
===================================================================
--- grass/branches/releasebranch_6_4/ps/ps.map/ps_vlegend.c	2015-08-15 22:20:44 UTC (rev 65944)
+++ grass/branches/releasebranch_6_4/ps/ps.map/ps_vlegend.c	2015-08-15 22:21:40 UTC (rev 65945)
@@ -31,7 +31,7 @@
      * If position is not used by any vector it is used for next not used vector without
      * lpos or lpos > vector.count */
 
-    nopos = -1;			/* last used without position in script or position > count */
+    nopos = -1;		/* last used without position in script or position > count */
 
     for (l = 0; l < vector.count; l++) {
 	nvec[l] = 0;
@@ -56,7 +56,7 @@
     }
 
     /* find last used row */
-    lcount = 0;			/* number of used rows in legend */
+    lcount = 0;		/* number of used rows in legend */
     for (i = vector.count - 1; i >= 0; i--) {
 	if (nvec[i] > 0) {
 	    lcount = i + 1;
@@ -255,8 +255,10 @@
 		}
 		else if (vector.layer[i].type == VPOINTS) {
 		    /* TODO */
-		    yo = y + 0.5 * fontsize - vector.layer[i].offset;
+		    /* yo = y + 0.5 * fontsize - vector.layer[i].offset; */
+		    yo = y + 0.5 * fontsize;
 		    xo = x + width / 2;
+
 		    symbol_draw(vector.layer[i].symbol_ps, xo, yo,
 				vector.layer[i].size, vector.layer[i].rotate,
 				vector.layer[i].width);



More information about the grass-commit mailing list