[GRASS-dev] display window coordinates

Hamish hamish_b at yahoo.com
Thu Dec 20 20:31:27 EST 2007


> Hamish wrote:
> > I am trying to fix d.save's recording of d.frame settings.
...
> > There is still a possible off-by-one error though, found at the
> > bottom of the top row of frames.
Glynn:
> It's because:
> 
> 1. d.frame at= has 0,0 at the bottom-left but the raster library and
>    drivers have 0,0 at the top-left.
> 
> 2. d.frame.split rounds 2/3 up to 66.6667
> 
> 3. The code which converts the percentage to pixels truncates rather
> than rounds.

lib/display/window.c updated in 6.3SVN to round. thanks for the hint.
Now the frames all draw (and d.redraw) well AFAICT.


> > I am trying to understand how the d_win=t,b,l,r window pad deals
> > with top and bottom.
> > 
> > GRASS_WIDTH and GRASS_HEIGHT are in number of pixels, xwininfo says
> > 600x900, yet the d_win pad runs from 0-900 = 901 integers.
> 
> 900-0 = 900, not 901.

I meant the integer set [0,900].

Hamish:
> > I could not find any clues in R_screen_bot(), R_screen_top()'s
> > comments in lib/raster/com_proto.c or in
> > lib/raster/rastergraphicslib.dox beyond "The upper left hand corner
> > of the screen is the origin." ...
Glynn:
> The top edge of the "screen" is at 0, the bottom edge is at 900. The
> top pixel row has its top edge at 0 and its bottom edge at 1. The
> bottom pixel row has its top edge at 899 and its bottom edge at 900.
...
> > or is it like the grass map region where the numbers are grid
> > coordinates not cell/pixel center coords??
> 
> The numbers are coordinates, not indices.

thanks, that makes sense.


Hamish



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the grass-dev mailing list