[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (c0786a1526e34a23f8c1db4eafd25e8c2ed8de34)



The branch, master has been updated
  discards  d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5 (commit)
       via  c0786a1526e34a23f8c1db4eafd25e8c2ed8de34 (commit)
      from  d0cc2001c5bbf7b4b99010e8e56cb5011c0da4e5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========



=================
 Commit Messages
=================

commit c0786a1526e34a23f8c1db4eafd25e8c2ed8de34
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    draw.c: Fix damage area computation
    
    We should reset the left and top bounds to MAXINT, and the right and
    bottom bounds to -MAXINT. This way the correct bounds are computed
    when gathering.
    
    The code previously every coordinate to 0, meaning that the box
    encompasing (0, 0)  up to the (max_x, max_y) would be invalidated,
    rather than (min_x, min_y) to (max_x, max_y).
    
    No improvement is going to be seen, as both the GTK and Lesstif GUIs
    ignore the damaged bounds and repaint the whole screen each time - it
    is just for correctness.

:100644 100644 bc00a7e... 707969a... M	src/draw.c

=========
 Changes
=========

commit c0786a1526e34a23f8c1db4eafd25e8c2ed8de34
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    draw.c: Fix damage area computation
    
    We should reset the left and top bounds to MAXINT, and the right and
    bottom bounds to -MAXINT. This way the correct bounds are computed
    when gathering.
    
    The code previously every coordinate to 0, meaning that the box
    encompasing (0, 0)  up to the (max_x, max_y) would be invalidated,
    rather than (min_x, min_y) to (max_x, max_y).
    
    No improvement is going to be seen, as both the GTK and Lesstif GUIs
    ignore the damaged bounds and repaint the whole screen each time - it
    is just for correctness.

diff --git a/src/draw.c b/src/draw.c
index bc00a7e..707969a 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -54,6 +54,10 @@
 #include <dmalloc.h>
 #endif
 
+#ifndef MAXINT
+#define MAXINT (((unsigned int)(~0))>>1)
+#endif
+
 RCSID ("$Id$");
 
 #define	SMALL_SMALL_TEXT_SIZE	0
@@ -75,7 +79,7 @@ FloatPolyType, *FloatPolyTypePtr;
 /* ---------------------------------------------------------------------------
  * some local identifiers
  */
-static BoxType Block;
+static BoxType Block = {MAXINT, MAXINT, -MAXINT, -MAXINT};
 static bool Gathering = true;
 
 static int doing_pinout = 0;
@@ -190,12 +194,14 @@ Draw (void)
 
   /* clear and create event if not drawing to a pixmap
    */
-  gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
+  if (Block.X1 <= Block.X2 && Block.Y1 <= Block.Y2)
+    gui->invalidate_lr (Block.X1, Block.X2, Block.Y1, Block.Y2);
 
   RestoreCrosshair ();
 
   /* shrink the update block */
-  Block.X1 = Block.Y1 = Block.X2 = Block.Y2 = 0;
+  Block.X1 = Block.Y1 =  MAXINT;
+  Block.X2 = Block.Y2 = -MAXINT;
 }
 
 /* ---------------------------------------------------------------------------




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs