---
 libgeda/include/prototype.h |    2 +-
 libgeda/src/o_bus_basic.c   |    4 +---
 libgeda/src/o_net_basic.c   |    4 +---
 libgeda/src/o_pin_basic.c   |    4 +---
 libgeda/src/s_tile.c        |   18 +++++++++---------
 5 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index b034ea5..a7df60d 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -478,7 +478,7 @@ void s_stretch_destroy_all(STRETCH *head);
 /* s_tile.c */
 void s_tile_init(TOPLEVEL *toplevel, PAGE *p_current);
 TILE_LOC *s_tile_new_loc(int i, int j);
-void s_tile_add_object(TOPLEVEL *toplevel, OBJECT *object, int world_x1, int 
world_y1, int world_x2, int world_y2);
+void s_tile_add_line_object(TOPLEVEL *toplevel, OBJECT *object);
 void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, OBJECT *object);
 void s_tile_update_object(TOPLEVEL *toplevel, OBJECT *object);
 GList *s_tile_get_objectlists(TOPLEVEL *toplevel, int world_x1, int world_y1, 
int world_x2, int world_y2);
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 987472e..9a4d8e6 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -80,9 +80,7 @@ OBJECT *o_bus_add(TOPLEVEL *toplevel, OBJECT *object_list,
 
   object_list = (OBJECT *) s_basic_link_object(new_node, object_list);
 
-  s_tile_add_object(toplevel, object_list,
-                    new_node->line->x[0], new_node->line->y[0], 
-                    new_node->line->x[1], new_node->line->y[1]);
+  s_tile_add_line_object(toplevel, object_list);
 
   if (!toplevel->ADDING_SEL) {
     s_conn_update_object(toplevel, object_list);
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index bf6c919..1538a0b 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -93,9 +93,7 @@ OBJECT *o_net_add(TOPLEVEL *toplevel, OBJECT *object_list, 
char type,
 
 
   if (!toplevel->ADDING_SEL) {
-    s_tile_add_object(toplevel, object_list,
-                     new_node->line->x[0], new_node->line->y[0],
-                     new_node->line->x[1], new_node->line->y[1]);
+    s_tile_add_line_object(toplevel, object_list);
     s_conn_update_object(toplevel, object_list);
   }
 
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 7e7f258..e58e1f7 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -79,9 +79,7 @@ OBJECT *o_pin_add(TOPLEVEL *toplevel, OBJECT *object_list,
   object_list = (OBJECT *) s_basic_link_object(new_node, object_list);
 
   if (!toplevel->ADDING_SEL) {
-    s_tile_add_object(toplevel, object_list,
-                      new_node->line->x[0], new_node->line->y[0], 
-                      new_node->line->x[1], new_node->line->y[1]);
+    s_tile_add_line_object(toplevel, object_list);
     s_conn_update_object(toplevel, object_list);
   }
 
diff --git a/libgeda/src/s_tile.c b/libgeda/src/s_tile.c
index a161fc5..2b7c91c 100644
--- a/libgeda/src/s_tile.c
+++ b/libgeda/src/s_tile.c
@@ -104,8 +104,7 @@ TILE_LOC *s_tile_new_loc(int i, int j)
  *  \par Function Description
  *
  */
-void s_tile_add_object(TOPLEVEL * toplevel, OBJECT * object, int world_x1,
-                      int world_y1, int world_x2, int world_y2)
+void s_tile_add_line_object (TOPLEVEL *toplevel, OBJECT *object)
 {
   TILE *t_current;
   PAGE *p_current;
@@ -124,6 +123,9 @@ void s_tile_add_object(TOPLEVEL * toplevel, OBJECT * 
object, int world_x1,
   printf("name: %s\n", object->name);
 #endif
 
+  g_return_if_fail (object != NULL);
+  g_return_if_fail (object->line != NULL);
+  
   if (toplevel->ADDING_SEL) {
 #if DEBUG    
     printf("s_tile_add_object, adding sel TRUE\n");
@@ -134,10 +136,10 @@ void s_tile_add_object(TOPLEVEL * toplevel, OBJECT * 
object, int world_x1,
   x_size = (double) toplevel->init_right / (double) MAX_TILES_X;
   y_size = (double) toplevel->init_bottom / (double) MAX_TILES_Y;
 
-  x1 = (int) (world_x1 / x_size);
-  x2 = (int) (world_x2 / x_size);
-  y1 = (int) (world_y1 / y_size);
-  y2 = (int) (world_y2 / y_size);
+  x1 = (int) (object->line->x[0] / x_size);
+  x2 = (int) (object->line->x[1] / x_size);
+  y1 = (int) (object->line->y[0] / y_size);
+  y2 = (int) (object->line->y[1] / y_size);
 
   bottom = x2 - x1;
   p_current = toplevel->page_current;
@@ -359,9 +361,7 @@ void s_tile_remove_object(TOPLEVEL *toplevel, PAGE *page, 
OBJECT *object)
 void s_tile_update_object(TOPLEVEL * toplevel, OBJECT * object)
 {
   s_tile_remove_object(toplevel, toplevel->page_current, object);
-  s_tile_add_object(toplevel, object,
-                    object->line->x[0], object->line->y[0],
-                    object->line->x[1], object->line->y[1]);
+  s_tile_add_line_object(toplevel, object);
 }
 
 
-- 
1.5.6




_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to