Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7446) center_on_something fails
Home

[Freeciv-Dev] (PR#7446) center_on_something fails

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7446) center_on_something fails
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 17:47:35 -0800
Reply-to: rt@xxxxxxxxxxx

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

When you first start a game, the focus unit is put in the top-left of 
the mapview (not the center as it should be).

When the first center_on_something (in handle_game_state I think) is 
called, the map canvas is not set up.  mapview_canvas.width == 
mapview_canvas.height == 0.  Thus centering on the unit puts it at 
(map_x0, map_y0).  When the canvas is set up this remains the origin.

There are several possible options:
   - When changing the mapview size keep the center, not the origin.
   - Ensure that the canvas is set up before centering (set up canvas
     earlier).
   - Recenter when changing canvas size.

Probably #1 and/or #2 is the best.

Raimar?

jaosn




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