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

gEDA-cvs: branch: master updated (1.4.0-20080127-32-g24f0395)



The branch, master has been updated
       via  24f0395aab9589f8e98f284e63fe77e6dc2d2836 (commit)
      from  0b2ce2cb246fa46eae2abe53c32e2c1a2f100093 (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
=========

 gschem/src/o_net.c |   46 +++++++++++++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 17 deletions(-)


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

commit 24f0395aab9589f8e98f284e63fe77e6dc2d2836
Author: Werner Hoch <werner.ho@xxxxxx>
Date:   Sun Mar 2 16:42:06 2008 +0100

    Fix drawing artefact in rubbernet drawing code
    
    The invalidation rectangles are to small if you're zoomed in.
    The half of the net width needs to be added to the rectangels.
    To do that, you need to sort the rectangle borders.

:100644 100644 1bbd66b... d28ba02... M	gschem/src/o_net.c

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

commit 24f0395aab9589f8e98f284e63fe77e6dc2d2836
Author: Werner Hoch <werner.ho@xxxxxx>
Date:   Sun Mar 2 16:42:06 2008 +0100

    Fix drawing artefact in rubbernet drawing code
    
    The invalidation rectangles are to small if you're zoomed in.
    The half of the net width needs to be added to the rectangels.
    To do that, you need to sort the rectangle borders.

diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index 1bbd66b..d28ba02 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -810,10 +810,10 @@ void o_net_drawrubber(GSCHEM_TOPLEVEL *w_current)
 		   2*magnetic_halfsize, 2*magnetic_halfsize,
 		   0, FULL_CIRCLE);
       o_invalidate_rect(w_current, 
-			w_current->magnetic_x - magnetic_halfsize,
-			w_current->magnetic_y - magnetic_halfsize,
-			w_current->magnetic_x + magnetic_halfsize,
-			w_current->magnetic_y + magnetic_halfsize);
+			w_current->magnetic_x - magnetic_halfsize - size/2,
+			w_current->magnetic_y - magnetic_halfsize - size/2,
+			w_current->magnetic_x + magnetic_halfsize + size/2,
+			w_current->magnetic_y + magnetic_halfsize + size/2);
     }
   }
 
@@ -821,15 +821,21 @@ void o_net_drawrubber(GSCHEM_TOPLEVEL *w_current)
   gdk_draw_line(w_current->backingstore, w_current->xor_gc,
 		w_current->start_x, w_current->start_y,
 		w_current->last_x, w_current->last_y);
-  o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
-                    w_current->last_x, w_current->last_y);
+  o_invalidate_rect(w_current, 
+		    min(w_current->start_x, w_current->last_x) - size/2,
+		    min(w_current->start_y, w_current->last_y) - size/2,
+		    max(w_current->start_x, w_current->last_x) + size/2,
+		    max(w_current->start_y, w_current->last_y) + size/2);
 
   /* Draw secondary line */
   gdk_draw_line(w_current->backingstore, w_current->xor_gc,
 		w_current->last_x, w_current->last_y,
 		w_current->second_x, w_current->second_y);
-  o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
-                    w_current->second_x, w_current->second_y);
+  o_invalidate_rect(w_current, 
+		    min(w_current->last_x, w_current->second_x) - size/2,
+		    min(w_current->last_y, w_current->second_y) - size/2,
+		    max(w_current->last_x, w_current->second_x) + size/2,
+		    max(w_current->last_y, w_current->second_y) + size/2);
 
   if (toplevel->net_style == THICK) {
     gdk_gc_set_line_attributes(w_current->xor_gc, 0,
@@ -872,25 +878,31 @@ void o_net_eraserubber(GSCHEM_TOPLEVEL *w_current)
 		 w_current->magnetic_y - magnetic_halfsize,
 		 2*magnetic_halfsize, 2*magnetic_halfsize,
 		 0, FULL_CIRCLE);
-    o_invalidate_rect(w_current,
-		      w_current->magnetic_x - magnetic_halfsize,
-		      w_current->magnetic_y - magnetic_halfsize,
-		      w_current->magnetic_x + magnetic_halfsize,
-		      w_current->magnetic_y + magnetic_halfsize);
+      o_invalidate_rect(w_current, 
+			w_current->magnetic_x - magnetic_halfsize - size/2,
+			w_current->magnetic_y - magnetic_halfsize - size/2,
+			w_current->magnetic_x + magnetic_halfsize + size/2,
+			w_current->magnetic_y + magnetic_halfsize + size/2);
   }
 
   /* Erase primary primary rubber net line */
   gdk_draw_line(w_current->backingstore, w_current->xor_gc, w_current->start_x,
 		w_current->start_y, w_current->last_x, w_current->last_y);
-  o_invalidate_rect(w_current, w_current->start_x, w_current->start_y,
-                               w_current->last_x, w_current->last_y);
+  o_invalidate_rect(w_current, 
+		    min(w_current->start_x, w_current->last_x) - size/2,
+		    min(w_current->start_y, w_current->last_y) - size/2,
+		    max(w_current->start_x, w_current->last_x) + size/2,
+		    max(w_current->start_y, w_current->last_y) + size/2);
 
   /* Erase secondary rubber net line */
   gdk_draw_line(w_current->backingstore, w_current->xor_gc,
 		w_current->last_x, w_current->last_y,
 		w_current->second_x, w_current->second_y);
-  o_invalidate_rect(w_current, w_current->last_x, w_current->last_y,
-                               w_current->second_x, w_current->second_y);
+  o_invalidate_rect(w_current, 
+		    min(w_current->last_x, w_current->second_x) - size/2,
+		    min(w_current->last_y, w_current->second_y) - size/2,
+		    max(w_current->last_x, w_current->second_x) + size/2,
+		    max(w_current->last_y, w_current->second_y) + size/2);
 
   if (toplevel->net_style == THICK) {
     gdk_gc_set_line_attributes(w_current->xor_gc, 0,




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