Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#8262) Map redraw
Home

[Freeciv-Dev] (PR#8262) Map redraw

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#8262) Map redraw
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Mar 2004 11:54:51 -0800
Reply-to: rt@xxxxxxxxxxx

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

This patch fixes the problem in map_canvas_resized.  It returns TRUE iff
the canvas was redrawn.  This should fix the bug in gtk and xaw clients.

jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.94
diff -u -r1.94 mapview_common.c
--- client/mapview_common.c     19 Mar 2004 20:22:07 -0000      1.94
+++ client/mapview_common.c     24 Mar 2004 19:53:19 -0000
@@ -2072,6 +2072,8 @@
 
 /**************************************************************************
   Called if the map in the GUI is resized.
+
+  Returns TRUE iff the canvas was redrawn.
 **************************************************************************/
 bool map_canvas_resized(int width, int height)
 {
@@ -2082,7 +2084,7 @@
   int tile_height = (height + NORMAL_TILE_HEIGHT - 1) / NORMAL_TILE_HEIGHT;
   int full_width = tile_width * NORMAL_TILE_WIDTH;
   int full_height = tile_height * NORMAL_TILE_HEIGHT;
-  bool tile_size_changed, size_changed;
+  bool tile_size_changed, size_changed, redrawn = FALSE;
 
   /* Resized */
 
@@ -2115,6 +2117,7 @@
     if (tile_size_changed) {
       update_map_canvas_visible();
       refresh_overview_canvas();
+      redrawn = TRUE;
     }
 
     /* If the width/height has changed, update the scrollbars even if
@@ -2125,7 +2128,7 @@
     }
   }
 
-  return TRUE;
+  return redrawn;
 }
 
 /**************************************************************************

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