Follow-up Comment #1, bug #15738 (project freeciv):
Some digging later:
The following is the automatic centering call at game start:
3: In Center on something
3: Center on any unit
3: ptile.x=11, ptile.y=45, gui.x=-1632, gui.y=1344
3: mapwid=1, maphei=1, tilewid=96
3: Enter set_mapview_origin
3: Seeing mapview origin to -1585 x 1367, slide=0
Then a center call I added in the gtk client:
3: ptile.x=11, ptile.y=45, gui.x=-1632, gui.y=1344
3: mapwid=784, maphei=520, tilewid=96
3: Enter set_mapview_origin
3: Seeing mapview origin to 1480 x 1108, slide=1
So the problem seems to be that mapview.width / mapview.height are not
initialized yet. The map size is set wheever the GTK+ client's map_canvas
sends the configure-event signal, which then happens after game start.
The quick workaround is simply a call to center_on_unit() when the game
starts / whenever we switch to the GAME page.
(file #8722)
_______________________________________________________
Additional Item Attachment:
File name: center_on_unit_S2_2.diff Size:0 KB
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?15738>
_______________________________________________
Meddelandet skickades via/av Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev