[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-400-g20e4ffc)
The branch, master has been updated
via 20e4ffcd895f344b8124ca16990f04e9570140c0 (commit)
from 4abd473222827786c2480fa128464c7ff45448ea (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 | 98 ++++++++++-----------------------------------------
1 files changed, 19 insertions(+), 79 deletions(-)
=================
Commit Messages
=================
commit 20e4ffcd895f344b8124ca16990f04e9570140c0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Fri Dec 19 23:49:36 2008 +0000
gschem: Tidy function o_move_end_rubberband()
This function is still buggy when objects are deleted as part of
the rubberbanding operation, but for now, tidy up the existing
code. No functional changes.
:100644 100644 6e2883e... 9eef304... M gschem/src/o_move.c
=========
Changes
=========
commit 20e4ffcd895f344b8124ca16990f04e9570140c0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Fri Dec 19 23:49:36 2008 +0000
gschem: Tidy function o_move_end_rubberband()
This function is still buggy when objects are deleted as part of
the rubberbanding operation, but for now, tidy up the existing
code. No functional changes.
diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 6e2883e..9eef304 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -494,14 +494,14 @@ int o_move_zero_length(OBJECT * object)
* \par Function Description
*
*/
-void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
- int world_diff_y,
- GList** objects,
- GList** prev_conn_objects, GList** connected_objects)
+void o_move_end_rubberband (GSCHEM_TOPLEVEL *w_current,
+ int w_dx, int w_dy,
+ GList** objects,
+ GList** prev_conn_objects,
+ GList** connected_objects)
{
TOPLEVEL *toplevel = w_current->toplevel;
GList *s_iter;
- int x, y;
for (s_iter = toplevel->page_current->stretch_list;
s_iter != NULL; s_iter = g_list_next (s_iter)) {
@@ -511,96 +511,36 @@ void o_move_end_rubberband(GSCHEM_TOPLEVEL *w_current, int world_diff_x,
switch (object->type) {
- case (OBJ_NET):
+ case OBJ_NET:
+ case OBJ_BUS:
/* save the other objects and remove object's connections */
*prev_conn_objects =
s_conn_return_others (*prev_conn_objects, object);
s_conn_remove_object (toplevel, object);
- x = object->line->x[whichone];
- y = object->line->y[whichone];
-
-#if DEBUG
- printf("OLD: %d, %d\n", x, y);
- printf("diff: %d, %d\n", world_diff_x, world_diff_y);
-#endif
-
- x = x + world_diff_x;
- y = y + world_diff_y;
-
-#if DEBUG
- printf("NEW: %d, %d\n", x, y);
-#endif
-
- object->line->x[whichone] = x;
- object->line->y[whichone] = y;
-
+ object->line->x[whichone] += w_dx;
+ object->line->y[whichone] += w_dy;
- if (o_move_zero_length(object)) {
- o_delete(w_current, object);
- } else {
- 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);
+ if (o_move_zero_length (object)) {
+ o_delete (w_current, object);
+ continue;
}
- break;
-
- case (OBJ_PIN):
-
- /* not valid to do with pins */
+ 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);
break;
- case (OBJ_BUS):
-
- /* save the other objects and remove object's connections */
- *prev_conn_objects =
- s_conn_return_others (*prev_conn_objects, object);
- s_conn_remove_object (toplevel, object);
-
- x = object->line->x[whichone];
- y = object->line->y[whichone];
-
-#if DEBUG
- printf("OLD: %d, %d\n", x, y);
- printf("diff: %d, %d\n", world_diff_x, world_diff_y);
-#endif
- x = x + world_diff_x;
- y = y + world_diff_y;
-
-#if DEBUG
- printf("NEW: %d, %d\n", x, y);
-#endif
- object->line->x[whichone] = x;
- object->line->y[whichone] = y;
-
- if (o_move_zero_length(object)) {
- o_delete(w_current, object);
- } else {
- 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);
- }
+ case OBJ_PIN:
+ /* NOP: not valid to do with pins */
break;
}
}
-
-#if DEBUG
- /*! \bug FIXME: moved_objects doesn't exist? */
- /*printf("%d\n", g_list_length(*moved_objects));*/
- printf("%d\n", g_list_length(*prev_conn_objects));
- printf("%d\n", g_list_length(*connected_objects));
-#endif
-
}
/*! \todo Finish function documentation!!!
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs