[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_complex_basic.c
User: pcjc2
Date: 07/03/23 20:57:08
Modified: . Tag: noscreen o_complex_basic.c
Log:
Modify world_get_single_object_bounds() to use cached bounds where possible.
Text objects are special-cased to determine if they are visible.
Revision Changes Path
No revision
No revision
1.30.2.4 +16 -41 eda/geda/gaf/libgeda/src/o_complex_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_complex_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_complex_basic.c,v
retrieving revision 1.30.2.3
retrieving revision 1.30.2.4
diff -u -b -r1.30.2.3 -r1.30.2.4
--- o_complex_basic.c 24 Mar 2007 00:52:40 -0000 1.30.2.3
+++ o_complex_basic.c 24 Mar 2007 00:57:08 -0000 1.30.2.4
@@ -61,64 +61,39 @@
if (o_current != NULL) {
switch(o_current->type) {
case(OBJ_LINE):
- world_get_line_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
- break;
-
case(OBJ_NET):
- /* same as a line (diff name)*/
- world_get_net_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
- break;
-
case(OBJ_BUS):
- /* same as a line (diff name)*/
- world_get_bus_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
- break;
-
case(OBJ_BOX):
- world_get_box_bounds(w_current, o_current->box, rleft, rtop, rright, rbottom);
- break;
-
case(OBJ_PICTURE):
- world_get_picture_bounds(w_current, o_current->picture, rleft, rtop, rright, rbottom);
- break;
-
case(OBJ_CIRCLE):
- world_get_circle_bounds(w_current, o_current->circle, rleft, rtop, rright, rbottom);
- break;
-
+ case(OBJ_PIN):
+ case(OBJ_ARC):
case(OBJ_COMPLEX):
case(OBJ_PLACEHOLDER):
- /* recursive objects ?*/
- if (!world_get_object_list_bounds(w_current, o_current->complex->prim_objs, rleft, rtop, rright, rbottom))
- return 0;
- break;
+ *rleft = o_current->w_left;
+ *rtop = o_current->w_top;
+ *rright = o_current->w_right;
+ *rbottom = o_current->w_bottom;
+ return 1;
case(OBJ_TEXT):
/* only do bounding boxes for visible or doing show_hidden_text*/
/* you might lose some attrs though */
- if (o_current->visibility == VISIBLE ||
- (o_current->visibility == INVISIBLE && w_current->show_hidden_text)) {
- if ( !world_get_text_bounds(w_current, o_current, rleft, rtop, rright, rbottom) )
- return 0;
- } else {
- return 0;
+ if ( o_current->visibility == VISIBLE ||
+ w_current->show_hidden_text ) {
+ *rleft = o_current->w_left;
+ *rtop = o_current->w_top;
+ *rright = o_current->w_right;
+ *rbottom = o_current->w_bottom;
+ return 1;
}
break;
- case(OBJ_PIN):
- world_get_pin_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
- break;
-
- case(OBJ_ARC):
- world_get_arc_bounds(w_current, o_current, rleft, rtop, rright, rbottom);
- break;
-
default:
- return 0;
break;
}
}
- return 1;
+ return 0;
}
/*! \brief Return the bounds of the given list of objects.
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs