Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8299) wrapping GUI coordinates
Home

[Freeciv-Dev] Re: (PR#8299) wrapping GUI coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8299) wrapping GUI coordinates
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Mar 2004 15:48:19 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8299 >

Jason Short wrote:

> In the hard way we convert the GUI position to a "native" gui position. 
>   The native position is aligned natively to the freeciv map, but 
> preserves pixel resolution so that each tile is of size 
> NORMAL_TILE_WIDHT*NORMAL_TILE_HEIGHT.  We can then wrap this position 
> directly before converting it back to a gui position.  Attached patch 
> "B" does this.  The disadvantage is that this is hard: it takes more 
> code than the above method, the math is hard to follow, and the very 
> concept of "gui-native" coordinates is a bit bizarre.  The advantage is 
> that it is a more flexible design: gui-native coordinates can be used to 
> do just about any topological operation needed on GUI coordinates while 
> preserving pixel resolution (for instance a gui_distance_vector() 
> function would be just a few lines).
> 
> I'm not sure which method is better.

IMO this method is better.  There are several other useful things we can 
do with gui-native coordinates.

jason




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