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

gEDA-cvs: branch: master updated (1.4.0-20080127-31-g0b2ce2c)



The branch, master has been updated
       via  0b2ce2cb246fa46eae2abe53c32e2c1a2f100093 (commit)
      from  ffd2298ca90e9e8616a2804c5708cb3d2ccb0a83 (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 |   75 +++++++++++++++++++++++++--------------------------
 1 files changed, 37 insertions(+), 38 deletions(-)


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

commit 0b2ce2cb246fa46eae2abe53c32e2c1a2f100093
Author: Werner Hoch <werner.ho@xxxxxx>
Date:   Sun Mar 2 16:20:27 2008 +0100

    Enlarge the magnetic net marker with increasing net line width
    
    When zooming in the magnetic marker became small relativ to the net
    width. This commit enlarges the magnetic marker with a constant factor
    relative to the net width. The line width of the marker is the
    same as the net width.

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

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

commit 0b2ce2cb246fa46eae2abe53c32e2c1a2f100093
Author: Werner Hoch <werner.ho@xxxxxx>
Date:   Sun Mar 2 16:20:27 2008 +0100

    Enlarge the magnetic net marker with increasing net line width
    
    When zooming in the magnetic marker became small relativ to the net
    width. This commit enlarges the magnetic marker with a constant factor
    relative to the net width. The line width of the marker is the
    same as the net width.

diff --git a/gschem/src/o_net.c b/gschem/src/o_net.c
index c7404d5..1bbd66b 100644
--- a/gschem/src/o_net.c
+++ b/gschem/src/o_net.c
@@ -295,7 +295,6 @@ void o_net_find_magnetic(GSCHEM_TOPLEVEL *w_current,
   double weight, min_weight;
   int magnetic_reach = 0;
   OBJECT *o_current;
-  OBJECT *o_simple;
   OBJECT *o_magnetic = NULL;
   GList *objectlists, *iter1, *iter2;
 
@@ -783,39 +782,41 @@ void o_net_rubbernet(GSCHEM_TOPLEVEL *w_current, int x, int y)
 void o_net_drawrubber(GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  int size;
+  int size=0, magnetic_halfsize;
 
   w_current->rubbernet_visible = 1;
 
+  if (toplevel->net_style == THICK) {
+    size = SCREENabs(toplevel, NET_WIDTH);
+    gdk_gc_set_line_attributes(w_current->xor_gc, size,
+			       GDK_LINE_SOLID,
+			       GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
+  }
+  size = max(size, 0);
+
+  gdk_gc_set_foreground(w_current->xor_gc,
+			x_get_darkcolor(w_current->select_color));
+
   if (w_current->magneticnet_mode) {
     if (w_current->magnetic_x != -1 && w_current->magnetic_y != -1) {
       w_current->magnetic_x = fix_x(toplevel, w_current->magnetic_x);
       w_current->magnetic_y = fix_y(toplevel, w_current->magnetic_y);
       w_current->magnetic_visible = 1;
       w_current->inside_action = 1;
+      magnetic_halfsize = max(4*size, MAGNETIC_HALFSIZE);
       gdk_draw_arc(w_current->backingstore, w_current->xor_gc, FALSE,
-		   w_current->magnetic_x - MAGNETIC_HALFSIZE,
-		   w_current->magnetic_y - MAGNETIC_HALFSIZE,
-		   2*MAGNETIC_HALFSIZE, 2*MAGNETIC_HALFSIZE,
+		   w_current->magnetic_x - magnetic_halfsize,
+		   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);
+			w_current->magnetic_x - magnetic_halfsize,
+			w_current->magnetic_y - magnetic_halfsize,
+			w_current->magnetic_x + magnetic_halfsize,
+			w_current->magnetic_y + magnetic_halfsize);
     }
   }
 
-  if (toplevel->net_style == THICK) {
-    size = SCREENabs(toplevel, NET_WIDTH);
-    gdk_gc_set_line_attributes(w_current->xor_gc, size,
-			       GDK_LINE_SOLID,
-			       GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
-  }
-
-  gdk_gc_set_foreground(w_current->xor_gc,
-			x_get_darkcolor(w_current->select_color));
-  
   /* draw primary line */
   gdk_draw_line(w_current->backingstore, w_current->xor_gc,
 		w_current->start_x, w_current->start_y,
@@ -848,37 +849,35 @@ void o_net_drawrubber(GSCHEM_TOPLEVEL *w_current)
 void o_net_eraserubber(GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  int size;
+  int size=0, magnetic_halfsize;
 
   if (! w_current->rubbernet_visible)
     return;
 
   w_current->rubbernet_visible = 0;
 
-  if (w_current->magnetic_visible) {
-    w_current->magnetic_visible = 0;
-    gdk_draw_arc(w_current->backingstore, w_current->xor_gc, FALSE,
-		 w_current->magnetic_x - MAGNETIC_HALFSIZE,
-		 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);
-  }
-
   if (toplevel->net_style == THICK) {
     size = SCREENabs(toplevel, NET_WIDTH);
-
-    if (size < 0)
-      size = 0;
-
     gdk_gc_set_line_attributes(w_current->xor_gc, size,
 			       GDK_LINE_SOLID,
 			       GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
   }
+  size = max(size, 0);
+
+  if (w_current->magnetic_visible) {
+    w_current->magnetic_visible = 0;
+    magnetic_halfsize = max(4*size, MAGNETIC_HALFSIZE);
+    gdk_draw_arc(w_current->backingstore, w_current->xor_gc, FALSE,
+		 w_current->magnetic_x - magnetic_halfsize,
+		 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);
+  }
 
   /* Erase primary primary rubber net line */
   gdk_draw_line(w_current->backingstore, w_current->xor_gc, w_current->start_x,




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