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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-53-gd0d1811)



The branch, master has been updated
       via  d0d18117a483029a61077a792203df5bd1a7f22a (commit)
       via  1ecd2a345ba49d7eb428d528d056f2c9f5e9b590 (commit)
       via  cc5ea879b0ccfc7815b43b30ddfae13941aff4eb (commit)
      from  29600e269da20822ec0443024c63cb5e0ae34ea2 (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_basic.c     |    1 +
 gschem/src/o_cue.c       |    6 ++++--
 gschem/src/o_move.c      |   44 +++++++++++++++++++++++++++++++++++++-------
 libgeda/include/struct.h |    1 +
 libgeda/src/s_basic.c    |    1 +
 5 files changed, 44 insertions(+), 9 deletions(-)


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

commit d0d18117a483029a61077a792203df5bd1a7f22a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:47:11 2008 +0100

    Don't drop artifacts when redrawing in the middle of a move operation
    
    The nets being rubberbanded should not be redrawn in their original
    positions, so we set the "dont_redraw" flag on the rubberband objects
    to ensure they are not drawn (in their un-stretched position) during
    screen updates. We unset the flag in o_move_end() and o_move_cancel().

:100644 100644 1bc3559... a86dd71... M	gschem/src/o_move.c

commit 1ecd2a345ba49d7eb428d528d056f2c9f5e9b590
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:40:20 2008 +0100

    gschem: Move freeing stretch list of to after move operation is ended
    
    Previously, the stretch list was left stale with pointers after a move
    operation, and only cleared when commencing a new move. By clearing it
    after each move operation (completed, or cancelled), we can ensure its
    contents are always valid.
    
    This is important so that at the end / cancellation of a move operation,
    we can operate on the stretch list without danger it was not up-to-date.
    If a move operation is started with rubberbanding disabled, and the user
    subsequently activates rubberbanding (during the move) with a key-stroke,
    stale pointers in the stretch list may have been dereferenced in error.

:100644 100644 3af0d6e... 1bc3559... M	gschem/src/o_move.c

commit cc5ea879b0ccfc7815b43b30ddfae13941aff4eb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:20:04 2008 +0100

    Add OBJECT flag "dont_redraw", to skip drawing individual objects.
    
    This flag is to be useful when handling move operations which hide
    rubberbanded objects on the page whilst a temporary copy is manipulated
    on screen.

:100644 100644 871e839... 37d6688... M	gschem/src/o_basic.c
:100644 100644 b3ecde5... 5c545ce... M	gschem/src/o_cue.c
:100644 100644 8a9ad2f... be99ef0... M	libgeda/include/struct.h
:100644 100644 998a8a5... a58723a... M	libgeda/src/s_basic.c

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

commit d0d18117a483029a61077a792203df5bd1a7f22a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:47:11 2008 +0100

    Don't drop artifacts when redrawing in the middle of a move operation
    
    The nets being rubberbanded should not be redrawn in their original
    positions, so we set the "dont_redraw" flag on the rubberband objects
    to ensure they are not drawn (in their un-stretched position) during
    screen updates. We unset the flag in o_move_end() and o_move_cancel().

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 1bc3559..a86dd71 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -39,6 +39,8 @@
 void o_move_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
+  STRETCH *st_current;
+
   if (o_select_selected (w_current)) {
 
     /* Save the current state. When rotating the selection when moving,
@@ -54,6 +56,15 @@ void o_move_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 
     if (w_current->netconn_rubberband) {
       o_move_prep_rubberband(w_current);
+
+      /* Set the dont_redraw flag on rubberbanded objects.
+       * This ensures that they are not drawn (in their
+       * un-stretched position) during screen updates. */
+      st_current = toplevel->page_current->stretch_head->next;
+      while (st_current != NULL) {
+        st_current->object->dont_redraw = TRUE;
+        st_current = st_current->next;
+      }
     }
 
     o_select_move_to_place_list(w_current);
@@ -123,6 +134,7 @@ void o_move_end_lowlevel(GSCHEM_TOPLEVEL *w_current, OBJECT * list, int type,
 void o_move_end(GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
+  STRETCH *st_current;
   GList *s_current = NULL;
   OBJECT *object;
   int diff_x, diff_y;
@@ -147,13 +159,20 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
 
   o_move_rubbermove_xor (w_current, FALSE);
 
-  if (w_current->netconn_rubberband)
-  {
+  if (w_current->netconn_rubberband) {
     o_move_end_rubberband(w_current, diff_x, diff_y,
                           &rubbernet_objects, &rubbernet_other_objects,
                           &rubbernet_connected_objects);
   }
 
+  /* Unset the dont_redraw flag on rubberbanded objects.
+   * We set this above, in o_move_start(). */
+  st_current = toplevel->page_current->stretch_head->next;
+  while (st_current != NULL) {
+    st_current->object->dont_redraw = FALSE;
+    st_current = st_current->next;
+  }
+
   s_current = geda_list_get_glist( toplevel->page_current->selection_list );
 
   while (s_current != NULL) {
@@ -257,6 +276,16 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
  */
 void o_move_cancel (GSCHEM_TOPLEVEL *w_current)
 {
+  TOPLEVEL *toplevel = w_current->toplevel;
+  STRETCH *st_current;
+
+  /* Unset the dont_redraw flag on rubberbanded objects.
+   * We set this above, in o_move_start(). */
+  st_current = toplevel->page_current->stretch_head->next;
+  while (st_current != NULL) {
+    st_current->object->dont_redraw = FALSE;
+    st_current = st_current->next;
+  }
   g_list_free(w_current->toplevel->page_current->complex_place_list);
   w_current->toplevel->page_current->complex_place_list = NULL;
   o_undo_callback(w_current, UNDO_ACTION);

commit 1ecd2a345ba49d7eb428d528d056f2c9f5e9b590
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:40:20 2008 +0100

    gschem: Move freeing stretch list of to after move operation is ended
    
    Previously, the stretch list was left stale with pointers after a move
    operation, and only cleared when commencing a new move. By clearing it
    after each move operation (completed, or cancelled), we can ensure its
    contents are always valid.
    
    This is important so that at the end / cancellation of a move operation,
    we can operate on the stretch list without danger it was not up-to-date.
    If a move operation is started with rubberbanding disabled, and the user
    subsequently activates rubberbanding (during the move) with a key-stroke,
    stale pointers in the stretch list may have been dereferenced in error.

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 3af0d6e..1bc3559 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -244,6 +244,9 @@ void o_move_end(GSCHEM_TOPLEVEL *w_current)
 
   g_list_free(toplevel->page_current->complex_place_list);
   toplevel->page_current->complex_place_list = NULL;
+
+  s_stretch_remove_most(toplevel, toplevel->page_current->stretch_head);
+  toplevel->page_current->stretch_tail = toplevel->page_current->stretch_head;
 }
 
 
@@ -258,6 +261,9 @@ void o_move_cancel (GSCHEM_TOPLEVEL *w_current)
   w_current->toplevel->page_current->complex_place_list = NULL;
   o_undo_callback(w_current, UNDO_ACTION);
   w_current->rotated_inside = 0;
+
+  s_stretch_remove_most(toplevel, toplevel->page_current->stretch_head);
+  toplevel->page_current->stretch_tail = toplevel->page_current->stretch_head;
 }
 
 
@@ -400,11 +406,6 @@ void o_move_prep_rubberband(GSCHEM_TOPLEVEL *w_current)
   OBJECT *object;
   OBJECT *o_current;
 
-  s_stretch_remove_most(toplevel,
-                        toplevel->page_current->stretch_head);
-  toplevel->page_current->stretch_tail =
-  toplevel->page_current->stretch_head;
-
 #if DEBUG
   printf("\n\n\n");
   s_stretch_print_all(toplevel->page_current->stretch_head);

commit cc5ea879b0ccfc7815b43b30ddfae13941aff4eb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Jul 29 01:20:04 2008 +0100

    Add OBJECT flag "dont_redraw", to skip drawing individual objects.
    
    This flag is to be useful when handling move operations which hide
    rubberbanded objects on the page whilst a temporary copy is manipulated
    on screen.

diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 871e839..37d6688 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -111,6 +111,7 @@ void o_redraw(GSCHEM_TOPLEVEL *w_current, OBJECT *list, gboolean draw_selected)
     if ((o_current->draw_func != NULL) &&
         (o_current->type != OBJ_HEAD)) {
       toplevel->DONT_REDRAW = redraw_state ||
+                              o_current->dont_redraw ||
                               (!draw_selected && o_current->selected);
       (*o_current->draw_func)(w_current, o_current);
     }
diff --git a/gschem/src/o_cue.c b/gschem/src/o_cue.c
index b3ecde5..5c545ce 100644
--- a/gschem/src/o_cue.c
+++ b/gschem/src/o_cue.c
@@ -49,7 +49,8 @@ void o_cue_redraw_all(GSCHEM_TOPLEVEL *w_current, OBJECT *head, gboolean draw_se
       case(OBJ_NET):
       case(OBJ_BUS):
       case(OBJ_PIN):
-	if (o_current->selected && !draw_selected) {
+	if (o_current->dont_redraw ||
+            (o_current->selected && !draw_selected)) {
 	  w_current->toplevel->DONT_REDRAW = 1 || redraw_state;
 	}
 	else {
@@ -60,7 +61,8 @@ void o_cue_redraw_all(GSCHEM_TOPLEVEL *w_current, OBJECT *head, gboolean draw_se
 
       case(OBJ_COMPLEX):
       case(OBJ_PLACEHOLDER):
-	if (o_current->selected && !draw_selected) {
+	if (o_current->dont_redraw ||
+            (o_current->selected && !draw_selected)) {
 	  toplevel->DONT_REDRAW = 1 || redraw_state;
 	}
 	else {
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index 8a9ad2f..be99ef0 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -240,6 +240,7 @@ struct st_object {
 
   int color; 				/* Which color */
   int saved_color; 			/* Saved color */
+  int dont_redraw;			/* Flag to skip redrawing */
   int selected;				/* object selected flag */
   int locked_color; 			/* Locked color (used to save */
   /* the object's real color */
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 998a8a5..a58723a 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -150,6 +150,7 @@ OBJECT *s_basic_init_object( char *name )
   new_node->color = WHITE;
   new_node->saved_color = -1;
   new_node->selected = FALSE;
+  new_node->dont_redraw = FALSE;
   new_node->locked_color = -1;
   new_node->draw_grips = FALSE;
 




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