[Freeciv-Dev] (PR#7446) center_on_something fails
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7446 >
> [jdorje - Fri Feb 20 01:47:34 2004]:
>
> 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.
This is a bad bug that needs to be fixed!
I don't see why it stopped working, though. I mean, it's obvious why it
doesn't work now, but why *did* it work before?
jason
|
|