Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#4585) bug in center_tile_overviewcanvas
Home

[Freeciv-Dev] (PR#4585) bug in center_tile_overviewcanvas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4585) bug in center_tile_overviewcanvas
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jul 2003 19:07:33 -0700
Reply-to: rt@xxxxxxxxxxxxxx

PR#4561 had a bug in it - center_tile_overviewcanvas is passed the 
center tile not the origin of the mapview, so we don't have to add back 
on the radius of the mapview.

Because the math is off, the overview doesn't center on the correct 
location (although it still behaves sanely).

jason

? rc
? client/output
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.47
diff -u -r1.47 mapview_common.c
--- client/mapview_common.c     2003/07/17 01:37:06     1.47
+++ client/mapview_common.c     2003/07/17 02:07:00
@@ -1116,16 +1116,8 @@
 **************************************************************************/
 static void center_tile_overviewcanvas(int map_x, int map_y)
 {
-  int screen_width;
-
-  if (is_isometric) {
-    screen_width = mapview_canvas.tile_width + mapview_canvas.tile_height;
-  } else {
-    screen_width = mapview_canvas.tile_width;
-  }
-
   /* Currently we just center the overview canvas around the tile. */
-  map_overview_x0 = map_adjust_x(map_x + screen_width / 2 - map.xsize / 2);
+  map_overview_x0 = map_adjust_x(map_x - map.xsize / 2);
 }
 
 /**************************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4585) bug in center_tile_overviewcanvas, Jason Short <=