Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10688) pixbuf error in canvas_put_sprite
Home

[Freeciv-Dev] (PR#10688) pixbuf error in canvas_put_sprite

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10688) pixbuf error in canvas_put_sprite
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Oct 2004 18:28:30 -0700
Reply-to: rt@xxxxxxxxxxx

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

Canvas_put_sprite will fail with pixbufs if a negative canvas position 
is given.  I ran into this in PR#10687.

This patch fixes it.  I think.

jason

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.145
diff -u -r1.145 mapview.c
--- client/gui-gtk-2.0/mapview.c        19 Oct 2004 21:17:34 -0000      1.145
+++ client/gui-gtk-2.0/mapview.c        23 Oct 2004 01:27:26 -0000
@@ -722,6 +722,17 @@
       {
        GdkPixbuf *src, *dst;
 
+       /* FIXME: is this right??? */
+       if (canvas_x < 0) {
+         offset_x -= canvas_x;
+         canvas_x = 0;
+       }
+       if (canvas_y < 0) {
+         offset_y -= canvas_y;
+         canvas_y = 0;
+       }
+
+
        src = sprite_get_pixbuf(sprite);
        dst = pcanvas->v.pixbuf;
        gdk_pixbuf_composite(src, dst, canvas_x, canvas_y,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10688) pixbuf error in canvas_put_sprite, Jason Short <=