[GRASS-dev] [grass-code I][377] d.vect map disp=dir now broken: G_plot_icon() bug?

Markus Neteler neteler at itc.it
Sat Apr 21 17:32:30 EDT 2007


On Sat, Apr 21, 2007 at 10:29:25PM +0100, Glynn Clements wrote:
> 
> 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[0][0] * x[i] + m[0][1] * y[i] + xc;
> > > 	y[i] = m[1][0] * x[i] + m[1][1] * 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:
> 
> Index: icon.c
> ===================================================================
> 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[0][0] * x[i] + m[0][1] * y[i] + xc;
> -	y[i] = m[1][0] * x[i] + m[1][1] * y[i] + yc;
> +	double xi = x[i];
> +	double yi = y[i];
> +
> +	x[i] = m[0][0] * xi + m[0][1] * yi + xc;
> +	y[i] = m[1][0] * xi + m[1][1] * yi + yc;
>      }
>  }
>  
> I have tested this and it appears to work now.
> 
> Committed to CVS.

Very nice. Also works for me.
Thanks,
Markus




More information about the grass-dev mailing list