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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-403-gc69785f)



The branch, master has been updated
       via  c69785fe267e2cdc70e2748dfab7268fbdcc3e7e (commit)
      from  fe8640898cb843b72e1c3cc01ee52c33db736ccf (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_move.c |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)


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

commit c69785fe267e2cdc70e2748dfab7268fbdcc3e7e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 01:08:08 2008 +0000

    o_move_end_rubberband(): Rework creating connectivity lists. Fix #2017356
    
    We were previously making a lists of pre- and post-move connected objects
    incrementally as we moved each individual object being stretched.
    
    In some cases this meant that as we moved one object, we artifically
    changed the connectivity of future ones to be moved, making the
    resulting connectivity lists inaccurate. In some examples, the objects
    being stretched themselves appeared in the lists.
    
    We want to avoid this, since if we delete a stretched object when
    it reaches zero length, we don't want that object to be referenced in
    the list of connected objects. Since we don't want to do more work
    than necessary re-drawing affected objects on screen, it is generally
    desirable to keep the lists as accurate as possible.
    
    To avoid the problem with incremental updates, build the connectivity
    lists before and after the entire move operation for stretched objects.
    
    This alone doesn't fix the case where a stretched object being deleted
    happens to touch another to start with. We have to check when deleting
    an object for its presence in the prev_conn_objects list. We check and
    remove _all_ references to the deleted object from that list.
    
    Thanks go to Patrick Bernaud for the test-case for this very tricky to
    reproduce bug, and an initial patch.

:100644 100644 d1fd6d1... 1317b82... M	gschem/src/o_move.c

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

commit c69785fe267e2cdc70e2748dfab7268fbdcc3e7e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 01:08:08 2008 +0000

    o_move_end_rubberband(): Rework creating connectivity lists. Fix #2017356
    
    We were previously making a lists of pre- and post-move connected objects
    incrementally as we moved each individual object being stretched.
    
    In some cases this meant that as we moved one object, we artifically
    changed the connectivity of future ones to be moved, making the
    resulting connectivity lists inaccurate. In some examples, the objects
    being stretched themselves appeared in the lists.
    
    We want to avoid this, since if we delete a stretched object when
    it reaches zero length, we don't want that object to be referenced in
    the list of connected objects. Since we don't want to do more work
    than necessary re-drawing affected objects on screen, it is generally
    desirable to keep the lists as accurate as possible.
    
    To avoid the problem with incremental updates, build the connectivity
    lists before and after the entire move operation for stretched objects.
    
    This alone doesn't fix the case where a stretched object being deleted
    happens to touch another to start with. We have to check when deleting
    an object for its presence in the prev_conn_objects list. We check and
    remove _all_ references to the deleted object from that list.
    
    Thanks go to Patrick Bernaud for the test-case for this very tricky to
    reproduce bug, and an initial patch.

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index d1fd6d1..1317b82 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -502,6 +502,19 @@ void o_move_end_rubberband (GSCHEM_TOPLEVEL *w_current,
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   GList *s_iter, *s_iter_next;
+  GList *iter;
+
+  /* save a list of objects the stretched objects
+     are connected to before we move them. */
+  for (s_iter = toplevel->page_current->stretch_list;
+       s_iter != NULL; s_iter = g_list_next (s_iter)) {
+    OBJECT *object = ((STRETCH *)s_iter->data)->object;
+
+    if (object->type == OBJ_NET ||
+        object->type == OBJ_BUS) {
+      *prev_conn_objects = s_conn_return_others (*prev_conn_objects, object);
+    }
+  }
 
   for (s_iter = toplevel->page_current->stretch_list;
        s_iter != NULL; s_iter = s_iter_next) {
@@ -515,9 +528,7 @@ void o_move_end_rubberband (GSCHEM_TOPLEVEL *w_current,
     if (object->type == OBJ_NET ||
         object->type == OBJ_BUS) {
 
-      /* save the other objects and remove object's connections */
-      *prev_conn_objects =
-        s_conn_return_others (*prev_conn_objects, object);
+      /* remove the object's connections */
       s_conn_remove_object (toplevel, object);
 
       object->line->x[whichone] += w_dx;
@@ -526,6 +537,7 @@ void o_move_end_rubberband (GSCHEM_TOPLEVEL *w_current,
       if (o_move_zero_length (object)) {
         toplevel->page_current->stretch_list =
           s_stretch_remove (toplevel->page_current->stretch_list, object);
+        *prev_conn_objects = g_list_remove_all (*prev_conn_objects, object);
         o_delete (w_current, object);
         continue;
       }
@@ -533,11 +545,16 @@ void o_move_end_rubberband (GSCHEM_TOPLEVEL *w_current,
       o_recalc_single_object (toplevel, object);
       s_tile_update_object (toplevel, object);
       s_conn_update_object (toplevel, object);
-      *connected_objects = s_conn_return_others (*connected_objects, object);
       *objects = g_list_append (*objects, object);
-
     }
   }
+
+  /* save a list of objects the stretched objects
+     are now connected to after we moved them. */
+  for (iter = *objects; iter != NULL; iter = g_list_next (iter)) {
+    OBJECT *object = iter->data;
+    *connected_objects = s_conn_return_others (*connected_objects, object);
+  }
 }
 
 /*! \todo Finish function documentation!!!




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