Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12593) Graphic errors in the FTWL client
Home

[Freeciv-Dev] Re: (PR#12593) Graphic errors in the FTWL client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12593) Graphic errors in the FTWL client
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Thu, 24 Mar 2005 12:12:01 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12593 >

On Wed, Mar 23, 2005 at 03:00:31PM -0800, Jason Short wrote:
> 
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12593 >
> 
> > [i-freeciv-lists@xxxxxxxxxxxxx - Tue Mar 22 21:47:24 2005]:
> > 
> > > The attached screenshot shows the FTWL client in iso mode. As you see
> > > there are two kind of errors. The one at the top also appears also in
> > > the non-iso mode.
> > 
> > One fixed. One still to go. On
> > http://www.freeciv.org/~rfalke/fs2005-03-22_iso_pics/ are pics of the
> > iso mode and also of the graphic error.
> 
> Here is a fix.

And my fix.

What now?

        Raimar

-- 
 email: i-freeciv-lists@xxxxxxxxxxxxx
  "brand memory are for windows users that think their stability
   problems come from the memory"
    -- bomek in #freeciv

Index: utility/ftwl/common_types.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/ftwl/common_types.c,v
retrieving revision 1.3
diff -u -u -r1.3 common_types.c
--- utility/ftwl/common_types.c 22 Jan 2005 19:45:45 -0000      1.3
+++ utility/ftwl/common_types.c 24 Mar 2005 20:09:01 -0000
@@ -339,7 +339,16 @@
   ct_clip_point(&p1, available);
   ct_clip_point(&p2, available);
 
-  ct_rect_fill_on_2_points(to_draw, &p1, &p2);
+  /* If after clipping the points are outside we have an empty area */
+  if (!ct_point_in_rect(&p1, to_draw) || !ct_point_in_rect(&p2, to_draw)) {
+    to_draw->x = 0;
+    to_draw->y = 0;
+    to_draw->width = 0;
+    to_draw->height = 0;
+  } else {
+    ct_rect_fill_on_2_points(to_draw, &p1, &p2);
+  }
+
   assert(ct_rect_in_rect(to_draw, available));
 }
 

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