[GRASS-dev] [grass-code I] d.vect map disp=dir now
broken: G_plot_icon() bug?
glynn at gclements.plus.com
Sat Apr 21 17:29:25 EDT 2007
Markus Neteler wrote:
> > > Since a few days the "disp=dir" no longer works.
> > > I recall to have seen some G_plot_icon() modifications. Could this
> > > be related? The positioning is right but the symbol invisible:
> > It could be related. I ended up multiplying by the scale twice, so if
> > the scale factor is significantly less than unity, the icons could end
> > up invisible.
> > Try changing lines 29-30 of lib/gis/icon.c to:
> > x[i] = m * x[i] + m * y[i] + xc;
> > y[i] = m * x[i] + m * y[i] + yc;
> > I'll commit this when CVS comes back to life.
> I have tried but it doesn't seem to help.
> Does it work for you now?
That was only half of the problem; this deals with the other half:
RCS file: /grassrepository/grass6/lib/gis/icon.c,v
retrieving revision 1.8
diff -u -r1.8 icon.c
--- icon.c 21 Apr 2007 20:37:46 -0000 1.8
+++ icon.c 21 Apr 2007 21:24:44 -0000
@@ -28,8 +28,11 @@
for ( i = 0; i < n_points; i++)
- x[i] = m * x[i] + m * y[i] + xc;
- y[i] = m * x[i] + m * y[i] + yc;
+ double xi = x[i];
+ double yi = y[i];
+ x[i] = m * xi + m * yi + xc;
+ y[i] = m * xi + m * yi + yc;
I have tested this and it appears to work now.
Committed to CVS.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev