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

gEDA-cvs: branch: master updated (1.1.2.20070818-93-g626f5c0)



The branch, master has been updated
       via  626f5c071a1dfea55e0214f6064b29908152d792 (commit)
       via  b20fa7e79e364fc8b5188ce8f6d9d807d8185a44 (commit)
      from  c3e9ed7bd974e4c8f8adbd7d61b44a11ed0edfe1 (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/include/prototype.h |    2 +-
 gschem/src/a_pan.c         |   41 +++++---
 gschem/src/o_basic.c       |  243 ++++++++++++--------------------------------
 gschem/src/o_complex.c     |   55 +---------
 gschem/src/o_copy.c        |   83 +--------------
 gschem/src/o_move.c        |   16 +---
 gschem/src/o_text.c        |   16 +--
 gschem/src/x_event.c       |   15 ++-
 8 files changed, 116 insertions(+), 355 deletions(-)


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

commit 626f5c071a1dfea55e0214f6064b29908152d792
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Nov 18 19:21:34 2007 +0000

    Update the all drawing state SCREEN co-ordinates when zooming / panning.
    
    By updating all of the co-ordinate state when zooming / panning, a redraw
    which includes a draw of any rubberbanded items will show them in the
    correct location. This allows XOR drawing to continue without dropping
    artifacts, or flashing up a "ghost" where the original element being moved
    was. The explicit erase for the gost item when moving is no longer needed.

:100644 100644 f9ba6b1... c684bb9... M	gschem/src/a_pan.c
:100644 100644 58f7a18... 152cb34... M	gschem/src/o_basic.c

commit b20fa7e79e364fc8b5188ce8f6d9d807d8185a44
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Nov 18 19:19:20 2007 +0000

    Rework o_drawbounding() to work without dropping artifacts in all modes.
    
    Simplifies both o_drawbounding(), and many functions which call it. No
    special casing outside o_drawbounding() is needed for OUTLINE vs.
    BOUNDINGBOX mode. Duplicated code has been reduced by making more use of
    o_drawbounding() during copying / complex OBJECT placement.
    
    This commit fixes bugs in code paths which aren't normally exercised, as
    the BOUNDINGBOX drawing mode isn't used any more. The code could be
    simplified further by removing the BOUNDINGBOX mode if desired.

:100644 100644 785cdf1... df33d5f... M	gschem/include/prototype.h
:100644 100644 bdbd0a7... 58f7a18... M	gschem/src/o_basic.c
:100644 100644 03edc9e... 055420b... M	gschem/src/o_complex.c
:100644 100644 fb000b6... a09f54b... M	gschem/src/o_copy.c
:100644 100644 4534c09... 2b87c8b... M	gschem/src/o_move.c
:100644 100644 4f6a614... 1bd7efe... M	gschem/src/o_text.c
:100644 100644 4cf1b39... 94575d5... M	gschem/src/x_event.c

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

commit 626f5c071a1dfea55e0214f6064b29908152d792
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Nov 18 19:21:34 2007 +0000

    Update the all drawing state SCREEN co-ordinates when zooming / panning.
    
    By updating all of the co-ordinate state when zooming / panning, a redraw
    which includes a draw of any rubberbanded items will show them in the
    correct location. This allows XOR drawing to continue without dropping
    artifacts, or flashing up a "ghost" where the original element being moved
    was. The explicit erase for the gost item when moving is no longer needed.

diff --git a/gschem/src/a_pan.c b/gschem/src/a_pan.c
index f9ba6b1..c684bb9 100644
--- a/gschem/src/a_pan.c
+++ b/gschem/src/a_pan.c
@@ -72,7 +72,9 @@ void a_pan_general(GSCHEM_TOPLEVEL *w_current, double world_cx, double world_cy,
   /* think it's better that the zoomfactor is defined as pix/mills
      this will be the same as w_current->page_current->to_screen_x/y_constant*/
   int zoom_max = 5;	
-  int start_x, start_y;
+  int start_x, start_y, last_x, last_y, second_x, second_y;
+  int loc_x, loc_y, save_x, save_y;
+  int distance = 0; /* Initialise to quiet compiler warning */
   int diff;
   double zx, zy, zoom_old, zoom_new, zoom_min;
 
@@ -112,9 +114,17 @@ void a_pan_general(GSCHEM_TOPLEVEL *w_current, double world_cx, double world_cy,
   /* check to see if we are inside an action draw net, etc.  If
    * yes, convert the start screen coords to world coords */
   if (w_current->inside_action) {
-    SCREENtoWORLD(toplevel,
-		  w_current->start_x, w_current->start_y,
-		  &start_x, &start_y);
+    SCREENtoWORLD(toplevel,  w_current->start_x,  w_current->start_y,
+                                       &start_x,            &start_y);
+    SCREENtoWORLD(toplevel,   w_current->last_x,   w_current->last_y,
+                                        &last_x,             &last_y);
+    SCREENtoWORLD(toplevel, w_current->second_x, w_current->second_y,
+                                      &second_x,           &second_y);
+    SCREENtoWORLD(toplevel,    w_current->loc_x,    w_current->loc_y,
+                                         &loc_x,              &loc_y);
+    SCREENtoWORLD(toplevel,   w_current->save_x,   w_current->save_y,
+                                        &save_x,             &save_y);
+    distance = WORLDabs(toplevel, w_current->distance);
     start_x = snap_grid(toplevel, start_x);
     start_y = snap_grid(toplevel, start_y);
   }
@@ -198,18 +208,17 @@ void a_pan_general(GSCHEM_TOPLEVEL *w_current, double world_cx, double world_cy,
 
   /* convert world coords back to screen coords */
   if (w_current->inside_action) {
-    WORLDtoSCREEN(toplevel,
-		  start_x, start_y,
-		  &(w_current->start_x), &(w_current->start_y));
-    /* set all rubberband points to it's start values:
-       As we don't draw the rubberbands after zooming/paning this
-       will lead the a redraw of the rubberbands with the next
-       motion event */
-    w_current->last_x = w_current->second_x = w_current->start_x;
-    w_current->save_x = w_current->start_x;
-    w_current->last_y = w_current->second_y = w_current->start_y;
-    w_current->save_y = w_current->start_y;
-    w_current->distance = w_current->loc_y = w_current->loc_x = 0;
+    WORLDtoSCREEN(toplevel,    start_x,              start_y,
+                   &w_current->start_x,  &w_current->start_y);
+    WORLDtoSCREEN(toplevel,     last_x,               last_y,
+                    &w_current->last_x,   &w_current->last_y);
+    WORLDtoSCREEN(toplevel,   second_x,             second_y,
+                  &w_current->second_x, &w_current->second_y);
+    WORLDtoSCREEN(toplevel,      loc_x,                loc_y,
+                     &w_current->loc_x,    &w_current->loc_y);
+    WORLDtoSCREEN(toplevel,     save_x,               save_y,
+                    &w_current->save_x,   &w_current->save_y);
+    w_current->distance = SCREENabs(toplevel, distance);
   }
 
   /* redraw */
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 58f7a18..152cb34 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -66,8 +66,6 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
     switch(w_current->event_state) {
       case(MOVE):
       case(ENDMOVE):
-        o_erase_selected(w_current);
-        /* continue */
       case(ENDCOPY):
       case(ENDMCOPY):
         o_drawbounding(w_current,

commit b20fa7e79e364fc8b5188ce8f6d9d807d8185a44
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Nov 18 19:19:20 2007 +0000

    Rework o_drawbounding() to work without dropping artifacts in all modes.
    
    Simplifies both o_drawbounding(), and many functions which call it. No
    special casing outside o_drawbounding() is needed for OUTLINE vs.
    BOUNDINGBOX mode. Duplicated code has been reduced by making more use of
    o_drawbounding() during copying / complex OBJECT placement.
    
    This commit fixes bugs in code paths which aren't normally exercised, as
    the BOUNDINGBOX drawing mode isn't used any more. The code could be
    simplified further by removing the BOUNDINGBOX mode if desired.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 785cdf1..df33d5f 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -477,7 +477,7 @@ void o_draw_selected(GSCHEM_TOPLEVEL *w_current);
 void o_erase_selected(GSCHEM_TOPLEVEL *w_current);
 void o_erase_single(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
 void o_erase_list(GSCHEM_TOPLEVEL *w_current, GList *list);
-void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist, GdkColor *color, int firsttime);
+void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist, GdkColor *color, int drawing);
 int o_erase_rubber(GSCHEM_TOPLEVEL *w_current);
 int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current);
 void o_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object);
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index bdbd0a7..58f7a18 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -72,20 +72,19 @@ void o_redraw_all(GSCHEM_TOPLEVEL *w_current)
       case(ENDMCOPY):
         o_drawbounding(w_current,
                        geda_list_get_glist( toplevel->page_current->selection_list ),
-                       x_get_darkcolor(w_current->bb_color), FALSE);
-
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         break;
 
       case(DRAWCOMP):
       case(ENDCOMP):
         o_drawbounding(w_current, toplevel->page_current->complex_place_list,
-                       x_get_darkcolor(w_current->bb_color), FALSE);
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         break;
 
       case(DRAWTEXT):
       case(ENDTEXT):
         o_drawbounding(w_current, toplevel->page_current->attrib_place_list,
-                       x_get_darkcolor(w_current->bb_color), FALSE);
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         break;
     }
   }
@@ -271,113 +270,67 @@ void o_erase_list(GSCHEM_TOPLEVEL *w_current, GList* list)
   }
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief XOR draw a bounding box or outline for OBJECT placement
+ *
  *  \par Function Description
+ *  This function XOR draws either the OBJECTS in the passed GList,
+ *  or a rectangle around their bounding box, depending upon the
+ *  currently selected w_current->actionfeedback_mode. This takes the
+ *  value BOUNDINGBOX or OUTLINE.
+ *
+ * The function applies manhatten mode constraints to the coordinates
+ * before drawing if the CONTROL key is recording as being pressed in
+ * the w_current structure.
+ *
+ * The "drawing" parameter is used to indicate if this drawing should
+ * immediately use the selected feedback mode and positioning constraints.
+ *
+ * With drawing=TRUE, the selected conditions are used immediately,
+ * otherwise the conditions from the last drawing operation are used,
+ * saving the new state for next time.
+ *
+ * o_drawbounding() should be called with drawing=TRUE when starting a
+ * rubberbanding operation and when otherwise refreshing the rubberbanded
+ * outline (e.g. after a screen redraw). For any undraw operation, should
+ * be called with drawing=FALSE, ensuring that the undraw XOR matches the
+ * mode and constraints of the corresponding "draw" operation.
+ *
+ * If any mode / constraint changes are made between a undraw, redraw XOR
+ * pair, the latter (draw) operation must be called with drawing=TRUE. If
+ * no mode / constraint changes were made between the pair, it is not
+ * harmful to call the draw operation with "drawing=FALSE".
  *
+ *  \param [in] w_current   GSCHEM_TOPLEVEL which we're drawing for.
+ *  \param [in] o_glst      GList of objects to XOR draw.
+ *  \param [in] color       GdkColor used for drawing in BOUNDINGBOX mode.
+ *  \param [in] drawing     Set to FALSE for undraw operations to ensure
+ *                            matching conditions to a previous draw operation.
  */
 /* both outline and boundingbox work! */
 /* name is blah */
 void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
-		    GdkColor *color, int firsttime)
+		    GdkColor *color, int drawing)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   int diff_x, diff_y;
   int test_x, test_y;
-
-  /* static is highly temp */	
-  /* you have to make these static... for the once mode */
-  static int rleft, rtop, rbottom, rright;
-  static int w_rleft, w_rtop, w_rbottom, w_rright;
+  int left, top, bottom, right;
+  int s_left, s_top, s_bottom, s_right;
 
   if (o_glist == NULL) {
     return;
   }
 
-  diff_x = w_current->last_x - w_current->start_x;
-  diff_y = w_current->last_y - w_current->start_y;
-
-  if ((w_current->last_drawb_mode == OUTLINE) &&
-      (w_current->actionfeedback_mode == BOUNDINGBOX)) {
-#if DEBUG
-    printf("going to bounding\n");
-#endif
-
-    gdk_gc_set_foreground(w_current->bounding_xor_gc,
-                          x_get_color(toplevel->background_color));
-    o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-
-    gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
-
-    world_get_object_glist_bounds(toplevel, o_glist,
-                                  &w_rleft, &w_rtop,
-                                  &w_rright, &w_rbottom);
-
-    WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-    WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-
-    gdk_draw_rectangle(w_current->window,
-                       w_current->bounding_xor_gc, FALSE,
-                       rleft + diff_x, rtop + diff_y,
-                       rright - rleft, rbottom - rtop);
-  }
-
-  if ((w_current->last_drawb_mode == BOUNDINGBOX) &&
-      (w_current->actionfeedback_mode == OUTLINE)) {
-#if DEBUG
-    printf("going to outline\n");
-#endif
-
-    world_get_object_glist_bounds(toplevel, o_glist,
-                                  &w_rleft, &w_rtop,
-                                  &w_rright, &w_rbottom);
-
-    gdk_gc_set_foreground(w_current->gc,
-                          x_get_color(toplevel->background_color));
-
-    WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-    WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-    gdk_draw_rectangle(w_current->window,
-                       w_current->gc, FALSE,
-                       rleft + diff_x, rtop + diff_y,
-                       rright - rleft, rbottom - rtop);
-
-    o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-
+  /* If drawing is true, then don't worry about the previous drawing
+   * method and movement constraints, use with the current settings */
+  if (drawing) {
+    w_current->last_drawb_mode = w_current->actionfeedback_mode;
+    w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
+                                            ? CONSTRAINED : FREE;
   }
 
-  w_current->last_drawb_mode = w_current->actionfeedback_mode;
-
-  /* everything above is okay */
-
-  /*! \todo much replicated code... this is the behaviour we need, but
-   * we need to clean it up !!!
-   */
-
-  /* erase old outline */
-  /* going to constrained from free */
-  if ( (w_current->CONTROLKEY) &&
-       (w_current->drawbounding_action_mode == FREE)) {
-    w_current->drawbounding_action_mode = CONSTRAINED;
-
-    if (w_current->actionfeedback_mode == OUTLINE) {
-      o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-
-    } else {
-      world_get_object_glist_bounds(toplevel, o_glist,
-                                    &w_rleft, &w_rtop,
-                                    &w_rright, &w_rbottom);
-
-      gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
-
-      WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-      WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-      gdk_draw_rectangle(w_current->window,
-                         w_current->bounding_xor_gc, FALSE,
-                         rleft + diff_x, rtop + diff_y,
-                         rright - rleft, rbottom - rtop);
-    }
-
+  /* Adjust the coordinates according to the movement constraints */
+  if (w_current->drawbounding_action_mode == CONSTRAINED ) {
     test_x = GET_BOX_WIDTH (w_current);
     test_y = GET_BOX_HEIGHT(w_current);
     if (test_x >= test_y) {
@@ -385,96 +338,32 @@ void o_drawbounding(GSCHEM_TOPLEVEL *w_current, GList *o_glist,
     } else {
       w_current->last_x = w_current->start_x;
     }
-
-    diff_x = w_current->last_x - w_current->start_x;
-    diff_y = w_current->last_y - w_current->start_y;
-
-    if (w_current->actionfeedback_mode == OUTLINE) {
-      o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-
-    } else {
-      world_get_object_glist_bounds(toplevel, o_glist,
-                                    &w_rleft, &w_rtop,
-                                    &w_rright, &w_rbottom);
-
-      gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
-
-      WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-      WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-      gdk_draw_rectangle(w_current->window,
-                         w_current->bounding_xor_gc,
-                         FALSE,
-                         rleft + diff_x, rtop + diff_y,
-                         rright - rleft, rbottom - rtop);
-    }
-
-    if (w_current->netconn_rubberband) {
-      o_move_stretch_rubberband(w_current);
-      o_move_stretch_rubberband(w_current);
-    }
   }
 
-  /* erase old outline */
-  /* going to free from constrained */
-  if ((!w_current->CONTROLKEY) &&
-      (w_current->drawbounding_action_mode == CONSTRAINED)) {
-        w_current->drawbounding_action_mode = FREE;
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          /* do it twice to get rid of old outline */
-          o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-          o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
-
-        } else {
-          /*! \todo why are we doing this here...?
-           * probably a reason */
-          world_get_object_glist_bounds(toplevel, o_glist,
-                                        &w_rleft, &w_rtop,
-                                        &w_rright, &w_rbottom);
-
-        }
-        if (w_current->netconn_rubberband) {
-          o_move_stretch_rubberband(w_current);
-          o_move_stretch_rubberband(w_current);
-        }
-      }
-
-  if (w_current->CONTROLKEY) {
-    test_x = GET_BOX_WIDTH (w_current);
-    test_y = GET_BOX_HEIGHT(w_current);
-    if (test_x >= test_y) {
-      w_current->last_y = w_current->start_y;
-    } else {
-      w_current->last_x = w_current->start_x;
-    }
-    diff_x = w_current->last_x - w_current->start_x;
-    diff_y = w_current->last_y - w_current->start_y;
-  }
-
-  if (w_current->actionfeedback_mode == BOUNDINGBOX) {
-
-    if (firsttime == TRUE) {
-      world_get_object_glist_bounds(toplevel, o_glist,
-                                    &w_rleft, &w_rtop,
-                                    &w_rright, &w_rbottom);
+  /* Calculate delta of X-Y positions from buffer's origin */
+  diff_x = w_current->last_x - w_current->start_x;
+  diff_y = w_current->last_y - w_current->start_y;
 
-      /*printf("once\n");*/
-    
-    }
+  /* XOR draw with the appropriate mode */
+  if (w_current->last_drawb_mode == BOUNDINGBOX) {
+    world_get_object_glist_bounds(toplevel, o_glist,
+                                  &left, &top, &right, &bottom);
     gdk_gc_set_foreground(w_current->bounding_xor_gc, color);
-    WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-    WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
+    WORLDtoSCREEN( toplevel, left, top, &s_left, &s_top );
+    WORLDtoSCREEN( toplevel, right, bottom, &s_right, &s_bottom );
     gdk_draw_rectangle(w_current->window,
                        w_current->bounding_xor_gc, FALSE,
-                       rleft + diff_x, rtop + diff_y,
-                       rright - rleft, rbottom - rtop);
-
-    return;
+                       s_left + diff_x, s_bottom + diff_y,
+                       s_right - s_left, s_top - s_bottom);
+  } else {
+    o_glist_draw_xor (w_current, diff_x, diff_y, o_glist);
   }
 
-  /*! \todo have I mentioned how temp this is? Make this general
-   * so that all lists can be moved ...
-   */
-  o_glist_draw_xor(w_current, diff_x, diff_y, o_glist);
+  /* Save movement constraints and drawing method for any
+   * corresponding undraw operation. */
+  w_current->last_drawb_mode = w_current->actionfeedback_mode;
+  w_current->drawbounding_action_mode = (w_current->CONTROLKEY)
+                                          ? CONSTRAINED : FREE;
 }
 
 
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 03edc9e..055420b 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -216,8 +216,6 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
   TOPLEVEL *toplevel = w_current->toplevel;
   int diff_x, diff_y;
   int x, y;
-  int rleft, rtop, rbottom, rright;
-  int w_rleft, w_rtop, w_rbottom, w_rright;
   OBJECT *o_current;
   OBJECT *o_start;
   OBJECT *o_temp;
@@ -238,6 +236,10 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
   printf("place_clib: %s\n",internal_clib);
 #endif
 
+  o_drawbounding(w_current,
+                 w_current->toplevel->page_current->complex_place_list,
+                 x_get_darkcolor(w_current->bb_color), FALSE);
+
   if (w_current->include_complex) {
     buffer = s_clib_symbol_get_data_by_name (toplevel->internal_symbol_name);
 
@@ -270,31 +272,6 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
 
     g_free(buffer);
 
-    if (w_current->actionfeedback_mode == OUTLINE) {
-      /* erase outline */
-      
-      o_glist_draw_xor(w_current, diff_x, diff_y,
-                       toplevel->page_current->complex_place_list);
-    } else {
-      world_get_object_glist_bounds(toplevel,
-			      toplevel->page_current->
-			      complex_place_list,
-			      &w_rleft, &w_rtop, &w_rright, &w_rbottom);
-
-      WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-      WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-
-      gdk_gc_set_foreground(
-                            w_current->gc,
-                            x_get_color(toplevel->background_color));
-      gdk_draw_rectangle(w_current->backingstore, w_current->gc,
-                         FALSE,
-                         rleft   + diff_x,
-                         rtop    + diff_y,
-                         rright  - rleft,
-                         rbottom - rtop);
-    }
-
     o_redraw(w_current, o_start, TRUE);
     toplevel->page_current->CHANGED = 1;
     o_undo_savestate(w_current, UNDO_ALL);
@@ -351,30 +328,6 @@ void o_complex_end(GSCHEM_TOPLEVEL *w_current, int screen_x, int screen_y)
     o_current->complex_embedded = TRUE;
   }
 
-  /* check for nulls in all this hack */
-  if (w_current->actionfeedback_mode == OUTLINE) {
-    /* erase outline */
-    o_glist_draw_xor(w_current, diff_x, diff_y,
-                     toplevel->page_current->complex_place_list);
-  } else {
-    world_get_object_glist_bounds(toplevel,
-                                  toplevel->page_current->complex_place_list,
-                                  &w_rleft, &w_rtop,
-                                  &w_rright, &w_rbottom);
-    
-    WORLDtoSCREEN( toplevel, w_rleft, w_rtop, &rleft, &rtop );
-    WORLDtoSCREEN( toplevel, w_rright, w_rbottom, &rright, &rbottom );
-
-    gdk_gc_set_foreground(
-                          w_current->gc,
-                          x_get_color(toplevel->background_color));
-    gdk_draw_rectangle(w_current->backingstore, w_current->gc, FALSE,
-                       rleft   + diff_x,
-                       rtop    + diff_y,
-                       rright  - rleft,
-                       rbottom - rtop);
-  }
-
   /*! \todo redraw has to happen at the end of all this hack or
    * maybe not? */
   s_delete_object_glist(toplevel, toplevel->page_current->
diff --git a/gschem/src/o_copy.c b/gschem/src/o_copy.c
index fb000b6..a09f54b 100644
--- a/gschem/src/o_copy.c
+++ b/gschem/src/o_copy.c
@@ -49,7 +49,6 @@ void o_copy_start(GSCHEM_TOPLEVEL *w_current, int x, int y)
     o_undo_savestate(w_current, UNDO_ALL);
 #endif
 
-    w_current->last_drawb_mode = -1;
     /* Shouldn't this set by the caller ? */
     /*    w_current->event_state = COPY; */
 
@@ -79,7 +78,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
   OBJECT *new_objects_head = NULL;
   OBJECT *object;
   int diff_x, diff_y;
-  int screen_diff_x, screen_diff_y;
   int lx, ly;
   int sx, sy;
   int color;
@@ -94,9 +92,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
     return;
   }
 
-  screen_diff_x = w_current->last_x - w_current->start_x;
-  screen_diff_y = w_current->last_y - w_current->start_y;
-
   SCREENtoWORLD(toplevel,
                 w_current->last_x, w_current->last_y,
                 &lx, &ly);
@@ -111,6 +106,11 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
   diff_x = lx - sx;
   diff_y = ly - sy;
 
+  /* erase the bounding box */
+  o_drawbounding(w_current,
+               geda_list_get_glist( toplevel->page_current->selection_list ),
+               x_get_darkcolor(w_current->bb_color), FALSE);
+
   s_current = geda_list_get_glist( toplevel->page_current->selection_list );
   new_objects_head = s_basic_init_object("object_head");
 
@@ -135,13 +135,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
                                             return_tail(new_objects_head),
                                             object );
         toplevel->ADDING_SEL=0;
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_net_draw_xor(w_current,
-                         screen_diff_x, screen_diff_y,
-                         object);
-        }
-
         o_net_translate_world(toplevel,
                               diff_x, diff_y,
                               new_object);
@@ -165,13 +158,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
                                            return_tail(new_objects_head), 
                                            object);
         toplevel->ADDING_SEL=0;
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_pin_draw_xor(w_current,
-                         screen_diff_x, screen_diff_y,
-                         object);
-        }
-
         o_pin_translate_world(toplevel,
                               diff_x, diff_y,
                               new_object);
@@ -195,13 +181,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
                                            return_tail(new_objects_head),
                                            object);
         toplevel->ADDING_SEL=0;
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_bus_draw_xor(w_current,
-                         screen_diff_x, screen_diff_y,
-                         object);
-        }
-
         o_bus_translate_world(toplevel,
                               diff_x, diff_y,
                               new_object);
@@ -234,11 +213,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         toplevel->ADDING_SEL=0;
 
         complex_object = new_object;
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_complex_draw_xor(w_current, screen_diff_x, screen_diff_y, object);
-        }
-
         o_complex_translate_world(toplevel, diff_x, diff_y, new_object);
 
         o_selection_add( temp_list, new_object );
@@ -260,12 +234,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         new_object = (OBJECT *) o_line_copy(toplevel,
                                             return_tail(new_objects_head),
                                             object);
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_line_draw_xor(w_current,
-                          screen_diff_x, screen_diff_y,
-                          object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_line_translate_world(toplevel,
                                diff_x, diff_y,
@@ -281,12 +249,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         new_object = (OBJECT *) o_box_copy(toplevel,
                                            return_tail(new_objects_head),
                                            object);
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_box_draw_xor(w_current,
-                         screen_diff_x, screen_diff_y,
-                         object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_box_translate_world(toplevel,
                               diff_x, diff_y,
@@ -303,12 +265,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         new_object = (OBJECT *) o_picture_copy(toplevel,
                                                return_tail(new_objects_head),
                                                object);
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_picture_draw_xor(w_current,
-                             screen_diff_x, screen_diff_y,
-                             object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_picture_translate_world(toplevel,
                                   diff_x, diff_y,
@@ -325,13 +281,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         new_object = (OBJECT *) o_circle_copy(toplevel,
                                               return_tail(new_objects_head),
                                               object);
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_circle_draw_xor(w_current,
-                            screen_diff_x, screen_diff_y,
-                            object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_circle_translate_world(toplevel,
                                  diff_x, diff_y,
@@ -347,13 +296,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
         new_object = (OBJECT *) o_arc_copy( toplevel,
                                             return_tail(new_objects_head),
                                             object );
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_arc_draw_xor(w_current,
-                         screen_diff_x, screen_diff_y,
-                         object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_arc_translate_world(toplevel,
                               diff_x, diff_y,
@@ -411,14 +353,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
 #endif
           }
         }
-
-        if (w_current->actionfeedback_mode == OUTLINE) {
-          o_text_draw_xor(w_current,
-                          screen_diff_x,
-                          screen_diff_y,
-                          object);
-        }
-
         toplevel->ADDING_SEL=1;
         o_text_translate_world(toplevel, diff_x, diff_y, new_object);
         toplevel->ADDING_SEL=0;
@@ -503,13 +437,6 @@ void o_copy_end(GSCHEM_TOPLEVEL *w_current)
   toplevel->page_current->object_tail = (OBJECT *)
   return_tail(toplevel->page_current->object_head);
 
-  /* erase the bounding box */
-  if (w_current->actionfeedback_mode == BOUNDINGBOX) {
-    o_drawbounding(w_current,
-                   geda_list_get_glist( toplevel->page_current->selection_list ),
-                   x_get_darkcolor(w_current->bb_color), TRUE);
-  }
-
   o_select_unselect_all( w_current );
   geda_list_add_glist( toplevel->page_current->selection_list, geda_list_get_glist( temp_list ) );
 
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 4534c09..2b87c8b 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -210,13 +210,10 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
                           &rubbernet_connected_objects);
   }
 
-  if (w_current->actionfeedback_mode == OUTLINE) {
-    o_drawbounding(w_current,
-                   geda_list_get_glist( toplevel->page_current->selection_list ),
-                   x_get_darkcolor(w_current->bb_color), TRUE);
-  }
+  o_drawbounding(w_current,
+                 geda_list_get_glist( toplevel->page_current->selection_list ),
+                 x_get_darkcolor(w_current->bb_color), FALSE);
 
-  /* skip over head node */
   s_current = geda_list_get_glist( toplevel->page_current->selection_list );
 
   while (s_current != NULL) {
@@ -280,13 +277,6 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
   /* Remove the undo saved in o_move_start */
   o_undo_remove_last_undo(w_current);
 
-  /* erase the bounding box */
-  if (w_current->actionfeedback_mode == BOUNDINGBOX) {
-    o_drawbounding(w_current,
-                   geda_list_get_glist( toplevel->page_current->selection_list ),
-                   x_get_darkcolor(w_current->bb_color), FALSE);
-  }
-
   /* Draw the objects that were moved (and connected/disconnected objects) */
   o_draw_selected(w_current);
   o_cue_undraw_list(w_current, other_objects);
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index 4f6a614..1bd7efe 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -397,6 +397,10 @@ void o_text_end(GSCHEM_TOPLEVEL *w_current)
   /*! \todo get consistant names */
   int world_x, world_y;
 
+  /* erase the old bounding box / outline */
+    o_drawbounding(w_current, toplevel->page_current->attrib_place_list,
+                   x_get_darkcolor(w_current->bb_color), FALSE);
+
   SCREENtoWORLD(toplevel,
                 w_current->last_x,
                 w_current->last_y,
@@ -419,18 +423,6 @@ void o_text_end(GSCHEM_TOPLEVEL *w_current)
              w_current->text_size,
              VISIBLE, SHOW_NAME_VALUE);
 
-  /*! \todo you need to erase the bounding box if have that mode
-     set!!! */
-
-  /* erase the old bounding box / outline */
-  if (w_current->actionfeedback_mode == OUTLINE) {
-    o_drawbounding(w_current, toplevel->page_current->attrib_place_list,
-                   x_get_color(w_current->text_color), FALSE);
-  } else {
-    o_drawbounding(w_current, toplevel->page_current->attrib_place_list,
-                   x_get_darkcolor(w_current->select_color), FALSE);
-  }
-
   toplevel->override_color = -1;
 
   toplevel->page_current->CHANGED=1;
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 4cf1b39..94575d5 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -92,14 +92,14 @@ gint x_event_expose(GtkWidget *widget, GdkEventExpose *event,
       case(ENDMCOPY):
         o_drawbounding(w_current,
                        geda_list_get_glist( toplevel->page_current->selection_list ),
-                       x_get_darkcolor(w_current->bb_color), FALSE);
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         break;
       case(DRAWCOMP):
       case(ENDCOMP):
       case(ENDPASTE):
         o_drawbounding(w_current,
                        toplevel->page_current->complex_place_list,
-                       x_get_darkcolor(w_current->bb_color), FALSE);
+                       x_get_darkcolor(w_current->bb_color), TRUE);
         break;
 
       case(BUSCONT):
@@ -721,6 +721,9 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 	/* Keep the state and the inside_action, as the copy has not finished. */	
 	w_current->last_x = w_current->start_x = fix_x(toplevel, mouse_x);
 	w_current->last_y = w_current->start_y = fix_y(toplevel, mouse_y);
+        o_drawbounding(w_current,
+                       geda_list_get_glist(toplevel->page_current->selection_list),
+                       x_get_darkcolor(w_current->bb_color), TRUE);
 	i_set_state(w_current, ENDMCOPY); 
         i_update_toolbar(w_current);
 	o_undo_savestate(w_current, UNDO_ALL);
@@ -776,7 +779,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
     if (w_current->inside_action) {
       if (w_current->event_state == ENDCOMP) {
         o_drawbounding(w_current, toplevel->page_current->complex_place_list,
-                       x_get_darkcolor(w_current->bb_color), TRUE);
+                       x_get_darkcolor(w_current->bb_color), FALSE);
 
         w_current->complex_rotate = 
         (w_current->complex_rotate + 90) % 360;
@@ -795,7 +798,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
         return(0);
       } else if (w_current->event_state == ENDTEXT) {
         o_drawbounding(w_current, toplevel->page_current->attrib_place_list,
-                       x_get_darkcolor(w_current->bb_color), TRUE);
+                       x_get_darkcolor(w_current->bb_color), FALSE);
 
         w_current->complex_rotate = 
         (w_current->complex_rotate + 90) % 360;
@@ -811,7 +814,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
 	prev_state = w_current->event_state;
 	
 	o_drawbounding(w_current, toplevel->page_current->complex_place_list,
-		       x_get_darkcolor(w_current->bb_color), TRUE);
+		       x_get_darkcolor(w_current->bb_color), FALSE);
 	
 	/* Don't allow o_rotate_90 to erase the selection, neither to
 	   redraw the objects after rotating */
@@ -1091,7 +1094,7 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
       w_current->last_y = fix_y(toplevel,  (int) event->y);
       o_drawbounding(w_current,
                      geda_list_get_glist( toplevel->page_current->selection_list ),
-                     x_get_darkcolor(w_current->bb_color), FALSE);
+                     x_get_darkcolor(w_current->bb_color), TRUE);
     }
     break;
 




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