Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8818) bug with gui coordinates and stippling
Home

[Freeciv-Dev] (PR#8818) bug with gui coordinates and stippling

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8818) bug with gui coordinates and stippling
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 May 2004 09:38:03 -0700
Reply-to: rt@xxxxxxxxxxx

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

As pointed out in PR#8210, when the mapview origin is moved by small 
amounts the fog drawing doesn't always work correctly.  You can see this 
by using the PR#8210 patch and scrolling one tile at a time.  The 
newly-drawn tiles will flicker on their way in.

I believe this happens because there is no origin set for the stippling. 
  The clip origin, surprisingly, does not affect the stippling.

This patch sets the stipple origin to be the sprite's origin.  I think 
it fixes the problem.

Note that if you had a tileset with odd tile dimensions it would still 
break.  The only way to solve that would be to set the stipple origin to 
be the GUI origin.  But of course it would be better just to use 
alpha-level drawing rather than stippling for fog.

This patch is for the gtk and gtk2 clients.  However I've only tested 
the gtk2 client.

jason

Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.220
diff -u -r1.220 mapview.c
--- client/gui-gtk/mapview.c    17 May 2004 07:16:42 -0000      1.220
+++ client/gui-gtk/mapview.c    23 May 2004 16:31:00 -0000
@@ -765,6 +765,7 @@
     gdk_gc_set_clip_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_clip_mask(fill_tile_gc, ssprite->mask);
     gdk_gc_set_foreground(fill_tile_gc, colors_standard[COLOR_STD_BLACK]);
+    gdk_gc_set_ts_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_stipple(fill_tile_gc, black50);
 
     gdk_draw_rectangle(pixmap, fill_tile_gc, TRUE,
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.125
diff -u -r1.125 mapview.c
--- client/gui-gtk-2.0/mapview.c        17 May 2004 07:16:42 -0000      1.125
+++ client/gui-gtk-2.0/mapview.c        23 May 2004 16:31:00 -0000
@@ -824,6 +824,7 @@
     gdk_gc_set_clip_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_clip_mask(fill_tile_gc, ssprite->mask);
     gdk_gc_set_foreground(fill_tile_gc, colors_standard[COLOR_STD_BLACK]);
+    gdk_gc_set_ts_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_stipple(fill_tile_gc, black50);
 
     gdk_draw_rectangle(pixmap, fill_tile_gc, TRUE,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8818) bug with gui coordinates and stippling, Jason Short <=