Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] cleanup to canvas_pos_to_map_pos
Home

[Freeciv-Dev] Re: [PATCH] cleanup to canvas_pos_to_map_pos

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx, freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] cleanup to canvas_pos_to_map_pos
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Mon, 31 Dec 2001 13:37:33 -0500

Note, the GUI coordinates have an origin topleft, and it is useful
to just think of everything in these terms. Thus you want to choose
your map, or at least think of it in the following way. Everything
is then in sync. 

+--->x
|
|
v
y

>>x x x
 >  x x x
>x x x
 >  x x x
<<x x x

Cheers,
RossW
=====

Note: "FLAT" coordinates is confusing "Flat-Earth" with "standard" map
      coordinates. Use standard when you need to refer to the old game
      coordinates standard reference system.

At 06:14 AM 01/12/31 -0500, Jason Short wrote:
>[1] Another word on this: in the mapview, the (x0, y0) tile has its top 
>corner at canvas position (0,0).  The mapview tiles are therefore set up 
>something like:
>
>  x x x
>x x x
>  x x x
>x x x
>
>Meanwhile, in the city view the (x0, y0) tile (which is (-2,2)) has its 
>_center_ at canvas position (0,0).  The mapview tiles are here set up 
>something like:
>
>x x x
>  x x x
>x x x
>  x x x
>
>Because of this difference the old code used different checks for the 
>city and map cases.  But it's easier to just shift the canvas position 
>before doing the calculation (or after translating the position).
>
>jason




[Prev in Thread] Current Thread [Next in Thread]