[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_arc_basic.c
User: pcjc2
Date: 07/02/25 08:41:25
Modified: . Tag: noscreen o_arc_basic.c o_box_basic.c
o_bus_basic.c o_circle_basic.c o_complex_basic.c
o_line_basic.c o_net_basic.c o_picture.c
o_pin_basic.c o_text_basic.c s_basic.c
Log:
Switched over to caching world rather than screen coordinates.
Removed screen coordinates from object datastructures, and renamed
variables storing cached bounds with prefix w_ to differentiate their world
coord usage. Changed s_basic.c to initialise all these variables to zero.
Converted code using those variables to world coordinates as appropriate.
Revision Changes Path
No revision
No revision
1.31.2.8 +6 -26 eda/geda/gaf/libgeda/src/o_arc_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_arc_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_arc_basic.c,v
retrieving revision 1.31.2.7
retrieving revision 1.31.2.8
diff -u -b -r1.31.2.7 -r1.31.2.8
--- o_arc_basic.c 25 Feb 2007 13:29:27 -0000 1.31.2.7
+++ o_arc_basic.c 25 Feb 2007 13:41:25 -0000 1.31.2.8
@@ -208,9 +208,6 @@
* If <B>whichone</B> is equal to #ARC_END_ANGLE, the <B>x</B> parameter is the ending angle of the arc.
* <B>x</B> is in degrees. <B>y</B> is ignored.
*
- * The screen coordinates of the arc and its bounding box are computed again
- * after the change in world coordinates.
- *
* \param [in] w_current The TOPLEVEL object.
* \param [in,out] object
* \param [in] x
@@ -529,42 +526,25 @@
* pointed structure.
* It also recalculates the <B>OBJECT</B> specific fields and the bounding box of the arc.
*
- * The bounding box - in screen units - is recalculated with the <B>get_arc_bounds()</B> function.
+ * The bounding box - in world units - is recalculated with the <B>world_get_arc_bounds()</B> function.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in] o_current
*/
void o_arc_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1, screen_x2, screen_y2;
int left, right, top, bottom;
if (o_current->arc == NULL) {
return;
}
- /* update the screen_x and screen_y fields of the arc */
- WORLDtoSCREEN(w_current, o_current->arc->x, o_current->arc->y,
- &screen_x1, &screen_y1);
-
- o_current->arc->screen_x = screen_x1; /* x coord */
- o_current->arc->screen_y = screen_y1; /* y coord */
-
- /* update the screen_width and screen_height fields of the arc */
- WORLDtoSCREEN(w_current,
- o_current->arc->x + o_current->arc->width,
- o_current->arc->y - o_current->arc->height,
- &screen_x2, &screen_y2);
-
- o_current->arc->screen_width = screen_x2 - screen_x1; /* width */
- o_current->arc->screen_height = screen_y2 - screen_y1; /* height */
-
/* recalculates the bounding box */
- get_arc_bounds(w_current, o_current, &left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ world_get_arc_bounds(w_current, o_current, &left, &top, &right, &bottom);
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
1.26.2.7 +14 -31 eda/geda/gaf/libgeda/src/o_box_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_box_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_box_basic.c,v
retrieving revision 1.26.2.6
retrieving revision 1.26.2.7
diff -u -b -r1.26.2.6 -r1.26.2.7
--- o_box_basic.c 25 Feb 2007 13:29:27 -0000 1.26.2.6
+++ o_box_basic.c 25 Feb 2007 13:41:25 -0000 1.26.2.7
@@ -169,7 +169,7 @@
* The dimensions of the new box are set with the ones of the original box.
* The two boxes have the same line type and the same filling options.
*
- * The coordinates and the values in screen unit are computed with
+ * The coordinates and the values in world unit are computed with
* #o_box_recalc().
*/
@@ -279,7 +279,7 @@
object->box->lower_y = tmp;
}
- /* recalculate the screen coords and the boundings */
+ /* recalculate the world coords and the boundings */
o_box_recalc(w_current, object);
}
@@ -566,7 +566,7 @@
object->box->lower_x += world_centerx;
object->box->lower_y += world_centery;
- /* recalc boundings and screen coords */
+ /* recalc boundings and world coords */
o_box_recalc(w_current, object);
}
@@ -614,17 +614,15 @@
object->box->lower_x += world_centerx;
object->box->lower_y += world_centery;
- /* recalc boundings and screen coords */
+ /* recalc boundings and world coords */
o_box_recalc(w_current, object);
}
-/*! \brief Recalculate BOX coordinates in SCREEN units.
+/*! \brief Recalculate BOX coordinates in WORLD units.
* \par Function Description
- * This function recalculates the screen coords of the <B>o_current</B> pointed
- * box object from its world coords.
- *
- * The box coordinates and its bounding are recalculated
+ * This function recalculates the box coordinates and its
+ * bounding are recalculated as well.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in,out] o_current BOX OBJECT to be recalculated.
@@ -632,33 +630,18 @@
void o_box_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
int left, top, right, bottom;
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
if (o_current->box == NULL) {
return;
}
- /* update the screen coords of the upper left corner of the box */
- WORLDtoSCREEN(w_current,
- o_current->box->upper_x, o_current->box->upper_y,
- &screen_x1, &screen_y1);
- o_current->box->screen_upper_x = screen_x1;
- o_current->box->screen_upper_y = screen_y1;
+ /* update the bounding box - world unit */
+ world_get_box_bounds(w_current, o_current->box, &left, &top, &right, &bottom);
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
- /* update the screen coords of the lower right corner of the box */
- WORLDtoSCREEN(w_current,
- o_current->box->lower_x, o_current->box->lower_y,
- &screen_x2, &screen_y2);
- o_current->box->screen_lower_x = screen_x2;
- o_current->box->screen_lower_y = screen_y2;
-
- /* update the bounding box - screen unit */
- get_box_bounds(w_current, o_current->box, &left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
}
/*! \brief Get BOX bounding rectangle.
1.17.2.6 +23 -92 eda/geda/gaf/libgeda/src/o_bus_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_bus_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_bus_basic.c,v
retrieving revision 1.17.2.5
retrieving revision 1.17.2.6
diff -u -b -r1.17.2.5 -r1.17.2.6
--- o_bus_basic.c 25 Feb 2007 13:29:27 -0000 1.17.2.5
+++ o_bus_basic.c 25 Feb 2007 13:41:25 -0000 1.17.2.6
@@ -94,7 +94,6 @@
int x1, int y1, int x2, int y2,
int bus_ripper_direction)
{
- int screen_x, screen_y;
int left, right, top, bottom;
OBJECT *new_node;
@@ -110,30 +109,14 @@
new_node->line->x[1] = x2;
new_node->line->y[1] = y2;
- WORLDtoSCREEN(w_current,
- new_node->line->x[0], new_node->line->y[0],
- &screen_x,
- &screen_y);
-
- new_node->line->screen_x[0] = screen_x;
- new_node->line->screen_y[0] = screen_y;
-
- WORLDtoSCREEN(w_current,
- new_node->line->x[1], new_node->line->y[1],
- &screen_x,
- &screen_y);
-
- new_node->line->screen_x[1] = screen_x;
- new_node->line->screen_y[1] = screen_y;
-
new_node->bus_ripper_direction = bus_ripper_direction;
- get_bus_bounds(w_current, new_node->line, &left, &top, &right, &bottom);
+ world_get_bus_bounds(w_current, new_node->line, &left, &top, &right, &bottom);
- new_node->left = left;
- new_node->top = top;
- new_node->right = right;
- new_node->bottom = bottom;
+ new_node->w_left = left;
+ new_node->w_top = top;
+ new_node->w_right = right;
+ new_node->w_bottom = bottom;
new_node->draw_func = bus_draw_func;
new_node->sel_func = select_func;
@@ -157,8 +140,6 @@
*/
void o_bus_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (o_current == NULL) {
@@ -169,29 +150,12 @@
return;
}
- WORLDtoSCREEN(w_current, o_current->line->x[0],
- o_current->line->y[0],
- &screen_x1,
- &screen_y1);
-
- o_current->line->screen_x[0] = screen_x1;
- o_current->line->screen_y[0] = screen_y1;
+ world_get_bus_bounds(w_current, o_current->line, &left, &top, &right, &bottom);
- WORLDtoSCREEN(w_current, o_current->line->x[1],
- o_current->line->y[1],
- &screen_x2,
- &screen_y2);
-
- o_current->line->screen_x[1] = screen_x2;
- o_current->line->screen_y[1] = screen_y2;
-
-
- get_bus_bounds(w_current, o_current->line, &left, &top, &right, &bottom);
-
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
@@ -285,43 +249,24 @@
*/
void o_bus_translate_world(TOPLEVEL *w_current, int x1, int y1, OBJECT *object)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (object == NULL) printf("btw NO!\n");
- /* Do world coords */
+ /* Update world coords */
object->line->x[0] = object->line->x[0] + x1;
object->line->y[0] = object->line->y[0] + y1;
object->line->x[1] = object->line->x[1] + x1;
object->line->y[1] = object->line->y[1] + y1;
- /* update screen coords */
- WORLDtoSCREEN(w_current, object->line->x[0],
- object->line->y[0],
- &screen_x1,
- &screen_y1);
-
- object->line->screen_x[0] = screen_x1;
- object->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, object->line->x[1],
- object->line->y[1],
- &screen_x2,
- &screen_y2);
-
- object->line->screen_x[1] = screen_x2;
- object->line->screen_y[1] = screen_y2;
-
- /* update bounding box */
- get_bus_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ /* Update bounding box */
+ world_get_bus_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
@@ -351,11 +296,6 @@
o_current->line->x[1], o_current->line->y[1],
o_current->bus_ripper_direction);
- new_obj->line->screen_x[0] = o_current->line->screen_x[0];
- new_obj->line->screen_y[0] = o_current->line->screen_y[0];
- new_obj->line->screen_x[1] = o_current->line->screen_x[1];
- new_obj->line->screen_y[1] = o_current->line->screen_y[1];
-
new_obj->line->x[0] = o_current->line->x[0];
new_obj->line->y[0] = o_current->line->y[0];
new_obj->line->x[1] = o_current->line->x[1];
@@ -684,26 +624,17 @@
void o_bus_modify(TOPLEVEL *w_current, OBJECT *object,
int x, int y, int whichone)
{
- int screen_x, screen_y;
int left, right, top, bottom;
object->line->x[whichone] = x;
object->line->y[whichone] = y;
- WORLDtoSCREEN(w_current,
- object->line->x[whichone],
- object->line->y[whichone],
- &screen_x, &screen_y);
-
- object->line->screen_x[whichone] = screen_x;
- object->line->screen_y[whichone] = screen_y;
-
- get_bus_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ world_get_bus_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
1.27.2.7 +11 -28 eda/geda/gaf/libgeda/src/o_circle_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_circle_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_circle_basic.c,v
retrieving revision 1.27.2.6
retrieving revision 1.27.2.7
diff -u -b -r1.27.2.6 -r1.27.2.7
--- o_circle_basic.c 25 Feb 2007 13:29:27 -0000 1.27.2.6
+++ o_circle_basic.c 25 Feb 2007 13:41:25 -0000 1.27.2.7
@@ -116,7 +116,7 @@
new_node->draw_func = circle_draw_func;
new_node->sel_func = select_func;
- /* compute the bounding box and screen coords */
+ /* compute the bounding box coords */
o_circle_recalc(w_current, new_node);
/* add the object to the list */
@@ -165,7 +165,7 @@
* circle. The two circle have the same line type and the same filling
* options.
*
- * The coordinates and the values in screen unit are computed with
+ * The bounding box coordinates are computed with
* #o_circle_recalc().
*/
/* modify */
@@ -211,8 +211,8 @@
* If <B>whichone</B> is equal to <B>CIRCLE_RADIUS</B>, the radius is given by
* <B>x</B> - in world units. <B>y</B> is ignored.
*
- * The screen coords and the bounding box of the circle object are updated
- * after the modification of its parameters.
+ * The bounding box of the circle object is updated after the modification of its
+ * parameters.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in,out] object Circle OBJECT to modify.
@@ -248,7 +248,7 @@
break;
}
- /* recalculate the screen coords and the boundings */
+ /* recalculate the boundings */
o_circle_recalc(w_current, object);
}
@@ -549,36 +549,19 @@
*/
void o_circle_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1;
int left, right, top, bottom;
if (o_current->circle == NULL) {
return;
}
-#if DEBUG
- printf("drawing circle\n");
-#endif
-
-
- /* update the screen coords of the center of the circle */
- WORLDtoSCREEN(w_current,
- o_current->circle->center_x, o_current->circle->center_y,
- &screen_x1, &screen_y1);
- o_current->circle->screen_x = screen_x1;
- o_current->circle->screen_y = screen_y1;
-
- /* update the value of the radius in screen unit */
- o_current->circle->screen_radius = SCREENabs(w_current,
- o_current->circle->radius);
-
- /* update the bounding box - screen unit */
- get_circle_bounds(w_current, o_current->circle,
+ /* update the bounding box - world unit */
+ world_get_circle_bounds(w_current, o_current->circle,
&left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
1.30.2.2 +78 -164 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.1
retrieving revision 1.30.2.2
diff -u -b -r1.30.2.1 -r1.30.2.2
--- o_complex_basic.c 27 Dec 2006 20:30:51 -0000 1.30.2.1
+++ o_complex_basic.c 25 Feb 2007 13:41:25 -0000 1.30.2.2
@@ -51,43 +51,46 @@
* \param [out] rtop pointer to the top coordinate of the object.
* \param [out] rright pointer to the right coordinate of the object.
* \param [out] rbottom pointer to the bottom coordinate of the object.
- *
+ * \return If any bounds were found for the object
+ * \retval 0 No bound was found
+ * \retval 1 Bound was found
*/
-void get_single_object_bounds(TOPLEVEL *w_current, OBJECT *o_current,
+int world_get_single_object_bounds(TOPLEVEL *w_current, OBJECT *o_current,
int *rleft, int *rtop, int *rright, int *rbottom)
{
if (o_current != NULL) {
switch(o_current->type) {
case(OBJ_LINE):
- get_line_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
+ world_get_line_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
break;
case(OBJ_NET):
/* same as a line (diff name)*/
- get_net_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
+ world_get_net_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
break;
case(OBJ_BUS):
/* same as a line (diff name)*/
- get_bus_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
+ world_get_bus_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
break;
case(OBJ_BOX):
- get_box_bounds(w_current, o_current->box, rleft, rtop, rright, rbottom);
+ world_get_box_bounds(w_current, o_current->box, rleft, rtop, rright, rbottom);
break;
case(OBJ_PICTURE):
- get_picture_bounds(w_current, o_current->picture, rleft, rtop, rright, rbottom);
+ world_get_picture_bounds(w_current, o_current->picture, rleft, rtop, rright, rbottom);
break;
case(OBJ_CIRCLE):
- get_circle_bounds(w_current, o_current->circle, rleft, rtop, rright, rbottom);
+ world_get_circle_bounds(w_current, o_current->circle, rleft, rtop, rright, rbottom);
break;
case(OBJ_COMPLEX):
case(OBJ_PLACEHOLDER):
/* recursive objects ?*/
- get_object_list_bounds(w_current, o_current->complex->prim_objs, rleft, rtop, rright, rbottom);
+ if (!world_get_object_list_bounds(w_current, o_current->complex->prim_objs, rleft, rtop, rright, rbottom))
+ return 0;
break;
case(OBJ_TEXT):
@@ -95,22 +98,27 @@
/* you might lose some attrs though */
if (o_current->visibility == VISIBLE ||
(o_current->visibility == INVISIBLE && w_current->show_hidden_text)) {
- get_text_bounds(w_current, o_current, rleft, rtop, rright, rbottom);
+ if ( !world_get_text_bounds(w_current, o_current, rleft, rtop, rright, rbottom) )
+ return 0;
+ } else {
+ return 0;
}
break;
case(OBJ_PIN):
- get_pin_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
+ world_get_pin_bounds(w_current, o_current->line, rleft, rtop, rright, rbottom);
break;
case(OBJ_ARC):
- get_arc_bounds(w_current, o_current, rleft, rtop, rright, rbottom);
+ world_get_arc_bounds(w_current, o_current, rleft, rtop, rright, rbottom);
break;
default:
+ return 0;
break;
}
}
+ return 1;
}
/*! \brief Return the bounds of the given list of objects.
@@ -121,34 +129,39 @@
* \param [out] top pointer to the top coordinate of the object.
* \param [out] right pointer to the right coordinate of the object.
* \param [out] bottom pointer to the bottom coordinate of the object.
+ * \return If any bounds were found for the list of objects
+ * \retval 0 No bounds were found
+ * \retval 1 Bound was found
*/
-void
-get_object_list_bounds(TOPLEVEL *w_current, OBJECT *complex,
+int
+world_get_object_list_bounds(TOPLEVEL *w_current, OBJECT *complex,
int *left, int *top, int *right, int *bottom)
{
OBJECT *o_current=NULL;
int rleft, rtop, rright, rbottom;
-
- *left = rleft = 999999;
- *top = rtop = 9999999;
- *right = rright = 0;
- *bottom = rbottom = 0;
-
+ int found = 0;
o_current = complex;
+ // Find the first object with bounds, and set the bounds variables, then expand as necessary
while ( o_current != NULL ) {
- get_single_object_bounds(w_current, o_current, &rleft, &rtop,
- &rright, &rbottom);
- if (rleft < *left) *left = rleft;
- if (rtop < *top) *top = rtop;
- if (rright > *right) *right = rright;
- if (rbottom > *bottom) *bottom = rbottom;
-
-
- o_current=o_current->next;
+ if ( world_get_single_object_bounds( w_current, o_current, &rleft, &rtop, &rright, &rbottom) ) {
+ if ( found ) {
+ *left = min( *left, rleft );
+ *top = min( *top, rtop );
+ *right = max( *right, rright );
+ *bottom = max( *bottom, rbottom );
+ } else {
+ *left = rleft;
+ *top = rtop;
+ *right = rright;
+ *bottom = rbottom;
+ found = 1;
}
-
+ }
+ o_current = o_current->next;
+ }
+ return found;
}
/*! \brief Return the bounds of the given GList of objects.
@@ -159,125 +172,43 @@
* \param [out] top pointer to the top coordinate of the object.
* \param [out] right pointer to the right coordinate of the object.
* \param [out] bottom pointer to the bottom coordinate of the object.
+ * \return If any bounds were found for the list of objects
+ * \retval 0 No bounds were found
+ * \retval 1 Bound was found
*/
-void get_object_glist_bounds(TOPLEVEL *w_current, GList *head,
+int world_get_object_glist_bounds(TOPLEVEL *w_current, GList *head,
int *left, int *top, int *right, int *bottom)
{
GList *s_current=NULL;
OBJECT *o_current=NULL;
int rleft, rtop, rright, rbottom;
-
- *left = rleft = 999999;
- *top = rtop = 9999999;
- *right = rright = 0;
- *bottom = rbottom = 0;
+ int found = 0;
s_current = head;
+ // Find the first object with bounds, and set the bounds variables, then expand as necessary
while ( s_current != NULL ) {
-
o_current = (OBJECT *) s_current->data;
-
g_assert (o_current != NULL);
-
- get_single_object_bounds(w_current, o_current, &rleft, &rtop,
- &rright, &rbottom);
-
- if (rleft < *left) *left = rleft;
- if (rtop < *top) *top = rtop;
- if (rright > *right) *right = rright;
- if (rbottom > *bottom) *bottom = rbottom;
-
-
- s_current=s_current->next;
- }
-
-}
-
-/*! \brief Return the bounds of the given object.
- * \par Given an object, calcule the bounds coordinates.
- * \param [in] w_current The toplevel structure.
- * \param [in] o_current The object to look the bounds for.
- * \param [out] left pointer to the left coordinate of the object.
- * \param [out] top pointer to the top coordinate of the object.
- * \param [out] right pointer to the right coordinate of the object.
- * \param [out] bottom pointer to the bottom coordinate of the object.
- *
- */
-void world_get_single_object_bounds(TOPLEVEL *w_current, OBJECT *o_current,
- int *left, int *top,
- int *right, int *bottom)
-{
- if (o_current != NULL ) {
- switch(o_current->type) {
- case(OBJ_LINE):
- world_get_line_bounds(w_current, o_current->line,
- left, top, right, bottom);
- break;
-
- case(OBJ_NET):
- /* same as a line (diff name)*/
- world_get_net_bounds(w_current, o_current->line,
- left, top, right, bottom);
- break;
-
- case(OBJ_BUS):
- /* same as a line (diff name)*/
- world_get_bus_bounds(w_current, o_current->line,
- left, top, right, bottom);
- break;
-
-
- case(OBJ_BOX):
- world_get_box_bounds(w_current, o_current->box,
- left, top, right, bottom);
- break;
-
- case(OBJ_PICTURE):
- world_get_picture_bounds(w_current, o_current->picture,
- left, top, right, bottom);
- break;
-
- case(OBJ_CIRCLE):
- world_get_circle_bounds(w_current, o_current->circle,
- left, top, right, bottom);
- break;
-
- case(OBJ_COMPLEX):
- case(OBJ_PLACEHOLDER):
- /* recursive objects ?*/
- world_get_complex_bounds(w_current, o_current->complex->prim_objs,
- left, top, right, bottom);
- break;
-
- 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)) {
- world_get_text_bounds(w_current, o_current,
- left, top, right, bottom);
+ if ( world_get_single_object_bounds( w_current, o_current, &rleft, &rtop, &rright, &rbottom) ) {
+ if ( found ) {
+ *left = min( *left, rleft );
+ *top = min( *top, rtop );
+ *right = max( *right, rright );
+ *bottom = max( *bottom, rbottom );
+ } else {
+ *left = rleft;
+ *top = rtop;
+ *right = rright;
+ *bottom = rbottom;
+ found = 1;
}
- break;
-
- case(OBJ_PIN):
- world_get_pin_bounds(w_current, o_current->line,
- left, top, right, bottom);
- break;
-
- case(OBJ_ARC):
- world_get_arc_bounds(w_current, o_current,
- left, top, right, bottom);
- break;
-
- default:
- break;
}
+ s_current = s_current->next;
}
+ return found;
}
-
/*! \brief Return the bounds of the given complex (or list of OBJECTs).
* \par Given a complex (list of objects), calcule the bounds coordinates.
* \param [in] w_current The toplevel structure.
@@ -464,9 +395,6 @@
new_node->complex->x = x;
new_node->complex->y = y;
- WORLDtoSCREEN(w_current, x, y,
- &new_node->complex->screen_x,
- &new_node->complex->screen_y);
new_node->draw_func = complex_draw_func;
@@ -738,9 +666,6 @@
new_node->complex = (COMPLEX *) g_malloc(sizeof(COMPLEX));
new_node->complex->x = x;
new_node->complex->y = y;
- WORLDtoSCREEN(w_current, x, y,
- &new_node->complex->screen_x,
- &new_node->complex->screen_y);
new_node->complex->angle = angle;
new_node->complex->mirror = 0;
@@ -791,17 +716,11 @@
if ((!o_current) || (o_current->type != OBJ_COMPLEX && o_current->type != OBJ_PLACEHOLDER))
return;
- get_object_list_bounds(w_current, o_current->complex->prim_objs, &left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
-
- WORLDtoSCREEN(w_current,
- o_current->complex->x,
- o_current->complex->y,
- &o_current->complex->screen_x,
- &o_current->complex->screen_y);
+ world_get_object_list_bounds(w_current, o_current->complex->prim_objs, &left, &top, &right, &bottom);
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
@@ -1066,21 +985,16 @@
object->complex->x = object->complex->x + x1;
object->complex->y = object->complex->y + y1;
- WORLDtoSCREEN(w_current, object->complex->x,
- object->complex->y,
- &object->complex->screen_x,
- &object->complex->screen_y);
-
o_complex_world_translate(w_current, x1, y1,
object->complex->prim_objs);
- get_object_list_bounds(w_current, object->complex->prim_objs,
+ world_get_object_list_bounds(w_current, object->complex->prim_objs,
&left, &top, &right, &bottom);
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
}
/*! \brief
1.26.2.7 +22 -60 eda/geda/gaf/libgeda/src/o_line_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_line_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_line_basic.c,v
retrieving revision 1.26.2.6
retrieving revision 1.26.2.7
diff -u -b -r1.26.2.6 -r1.26.2.7
--- o_line_basic.c 25 Feb 2007 13:29:27 -0000 1.26.2.6
+++ o_line_basic.c 25 Feb 2007 13:41:25 -0000 1.26.2.7
@@ -103,7 +103,7 @@
new_node->draw_func = line_draw_func;
new_node->sel_func = select_func;
- /* compute bounding box and screen coords */
+ /* compute bounding box */
o_line_recalc(w_current, new_node);
object_list = (OBJECT *) s_basic_link_object(new_node, object_list);
@@ -149,7 +149,7 @@
* of the original line. The two lines have the sale line type and
* filling options.
*
- * The coordinates and the values in screen unit are computed with
+ * The bounding box are computed with
* #o_line_recalc().
*/
@@ -168,7 +168,7 @@
o_current->fill_pitch1, o_current->fill_angle1,
o_current->fill_pitch2, o_current->fill_angle2);
- /* calc the screen coords */
+ /* calc the bounding box */
o_line_recalc(w_current, o_current);
/* new_obj->attribute = 0;*/
@@ -231,7 +231,7 @@
return;
}
- /* recalculate the screen coords and the boundings */
+ /* recalculate the bounding box */
o_line_recalc(w_current, object);
}
@@ -405,40 +405,23 @@
void o_line_translate_world(TOPLEVEL *w_current,
int x1, int y1, OBJECT *object)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (object == NULL) printf("ltw NO!\n");
- /* Do world coords */
+ /* Update world coords */
object->line->x[0] = object->line->x[0] + x1;
object->line->y[0] = object->line->y[0] + y1;
object->line->x[1] = object->line->x[1] + x1;
object->line->y[1] = object->line->y[1] + y1;
- /* update screen coords */
- WORLDtoSCREEN(w_current, object->line->x[0],
- object->line->y[0],
- &screen_x1,
- &screen_y1);
- object->line->screen_x[0] = screen_x1;
- object->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, object->line->x[1],
- object->line->y[1],
- &screen_x2,
- &screen_y2);
- object->line->screen_x[1] = screen_x2;
- object->line->screen_y[1] = screen_y2;
-
- /* update bounding box */
- get_line_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ /* Update bounding box */
+ world_get_line_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
}
@@ -527,45 +510,26 @@
/*! \brief Recalculate line coordinates in SCREEN units.
* \par Function Description
- * This function recalculate the screen coords of the <B>o_current</B>
- * pointed line object from its world coords.
- *
- * The line ends coordinates and its bounding box are recalculated
+ * This function recalculate the bounding box of the <B>o_current</B>
*
* \param [in] w_current The TOPLEVEL object.
* \param [in,out] o_current Line OBJECT to be recalculated.
*/
void o_line_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (o_current->line == NULL) {
return;
}
- /* update the screen coords of end 1 of the line */
- WORLDtoSCREEN(w_current,
- o_current->line->x[0], o_current->line->y[0],
- &screen_x1, &screen_y1);
- o_current->line->screen_x[0] = screen_x1;
- o_current->line->screen_y[0] = screen_y1;
-
- /* update the screen coords of end 2 of the line */
- WORLDtoSCREEN(w_current,
- o_current->line->x[1], o_current->line->y[1],
- &screen_x2, &screen_y2);
- o_current->line->screen_x[1] = screen_x2;
- o_current->line->screen_y[1] = screen_y2;
-
/* update the bounding box - screen unit */
- get_line_bounds(w_current, o_current->line,
+ world_get_line_bounds(w_current, o_current->line,
&left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
@@ -1356,7 +1320,7 @@
object->line->x[1] = object->line->x[1] * x_scale;
object->line->y[1] = object->line->y[1] * y_scale;
- /* update screen coords */
+ /* update boundingbox */
o_line_recalc(w_current, object);
}
@@ -1383,10 +1347,8 @@
return(TRUE);
}
- *x1 = line->screen_x[0];
- *y1 = line->screen_y[0];
- *x2 = line->screen_x[1];
- *y2 = line->screen_y[1];
+ WORLDtoSCREEN( w_current, line->x[0], line->y[0], x1, y1 );
+ WORLDtoSCREEN( w_current, line->x[1], line->y[1], x2, y2 );
visible = SCREENclip_change(w_current, x1, y1, x2, y2);
1.34.2.6 +23 -80 eda/geda/gaf/libgeda/src/o_net_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_net_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_net_basic.c,v
retrieving revision 1.34.2.5
retrieving revision 1.34.2.6
diff -u -b -r1.34.2.5 -r1.34.2.6
--- o_net_basic.c 25 Feb 2007 13:29:27 -0000 1.34.2.5
+++ o_net_basic.c 25 Feb 2007 13:41:25 -0000 1.34.2.6
@@ -123,7 +123,6 @@
OBJECT *o_net_add(TOPLEVEL *w_current, OBJECT *object_list, char type,
int color, int x1, int y1, int x2, int y2)
{
- int screen_x, screen_y;
int left, right, top, bottom;
OBJECT *new_node;
@@ -139,27 +138,13 @@
new_node->line->x[1] = x2;
new_node->line->y[1] = y2;
- WORLDtoSCREEN(w_current,
- new_node->line->x[0], new_node->line->y[0],
- &screen_x, &screen_y);
-
- new_node->line->screen_x[0] = screen_x;
- new_node->line->screen_y[0] = screen_y;
-
- WORLDtoSCREEN(w_current,
- new_node->line->x[1], new_node->line->y[1],
- &screen_x, &screen_y);
-
- new_node->line->screen_x[1] = screen_x;
- new_node->line->screen_y[1] = screen_y;
-
- get_net_bounds(w_current, new_node->line, &left, &top, &right,
+ world_get_net_bounds(w_current, new_node->line, &left, &top, &right,
&bottom);
- new_node->left = left;
- new_node->top = top;
- new_node->right = right;
- new_node->bottom = bottom;
+ new_node->w_left = left;
+ new_node->w_top = top;
+ new_node->w_right = right;
+ new_node->w_bottom = bottom;
new_node->draw_func = net_draw_func;
new_node->sel_func = select_func;
@@ -185,8 +170,6 @@
*/
void o_net_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (o_current == NULL) {
@@ -197,25 +180,13 @@
return;
}
- WORLDtoSCREEN(w_current, o_current->line->x[0],
- o_current->line->y[0], &screen_x1, &screen_y1);
-
- o_current->line->screen_x[0] = screen_x1;
- o_current->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, o_current->line->x[1],
- o_current->line->y[1], &screen_x2, &screen_y2);
-
- o_current->line->screen_x[1] = screen_x2;
- o_current->line->screen_y[1] = screen_y2;
-
- get_net_bounds(w_current, o_current->line, &left, &top, &right,
+ world_get_net_bounds(w_current, o_current->line, &left, &top, &right,
&bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
@@ -304,40 +275,25 @@
void o_net_translate_world(TOPLEVEL *w_current, int x1, int y1,
OBJECT *object)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (object == NULL)
printf("ntw NO!\n");
- /* Do world coords */
+ /* Update world coords */
object->line->x[0] = object->line->x[0] + x1;
object->line->y[0] = object->line->y[0] + y1;
object->line->x[1] = object->line->x[1] + x1;
object->line->y[1] = object->line->y[1] + y1;
- /* update screen coords */
- WORLDtoSCREEN(w_current, object->line->x[0],
- object->line->y[0], &screen_x1, &screen_y1);
-
- object->line->screen_x[0] = screen_x1;
- object->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, object->line->x[1],
- object->line->y[1], &screen_x2, &screen_y2);
-
- object->line->screen_x[1] = screen_x2;
- object->line->screen_y[1] = screen_y2;
-
- /* update bounding box */
- get_net_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ /* Update bounding box */
+ world_get_net_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
@@ -369,11 +325,6 @@
o_current->line->x[0], o_current->line->y[0],
o_current->line->x[1], o_current->line->y[1]);
- new_obj->line->screen_x[0] = o_current->line->screen_x[0];
- new_obj->line->screen_y[0] = o_current->line->screen_y[0];
- new_obj->line->screen_x[1] = o_current->line->screen_x[1];
- new_obj->line->screen_y[1] = o_current->line->screen_y[1];
-
new_obj->line->x[0] = o_current->line->x[0];
new_obj->line->y[0] = o_current->line->y[0];
new_obj->line->x[1] = o_current->line->x[1];
@@ -843,25 +794,17 @@
void o_net_modify(TOPLEVEL *w_current, OBJECT *object,
int x, int y, int whichone)
{
- int screen_x, screen_y;
int left, right, top, bottom;
object->line->x[whichone] = x;
object->line->y[whichone] = y;
- WORLDtoSCREEN(w_current,
- object->line->x[whichone],
- object->line->y[whichone], &screen_x, &screen_y);
-
- object->line->screen_x[whichone] = screen_x;
- object->line->screen_y[whichone] = screen_y;
-
- get_net_bounds(w_current, object->line, &left, &top, &right, &bottom);
+ world_get_net_bounds(w_current, object->line, &left, &top, &right, &bottom);
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
1.5.2.6 +9 -27 eda/geda/gaf/libgeda/src/o_picture.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_picture.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_picture.c,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -u -b -r1.5.2.5 -r1.5.2.6
--- o_picture.c 25 Feb 2007 13:29:27 -0000 1.5.2.5
+++ o_picture.c 25 Feb 2007 13:41:25 -0000 1.5.2.6
@@ -454,12 +454,10 @@
return(object_list);
}
-/*! \brief Recalculate picture coordinates in SCREEN units.
+/*! \brief Recalculate picture bounding box.
* \par Function Description
- * This function recalculates the screen coords of the <B>o_current</B>
- * parameter picture object from its world coords.
- *
- * The picture coordinates and its bounding are recalculated
+ * This function recalculates the bounding box of the <B>o_current</B>
+ * parameter picture object.
*
* \param [in] w_current The TOPLEVEL object.
* \param [in,out] o_current Picture OBJECT to be recalculated.
@@ -467,34 +465,18 @@
void o_picture_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
int left, top, right, bottom;
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
if (o_current->picture == NULL) {
return;
}
- /* update the screen coords of the upper left corner of the picture */
- WORLDtoSCREEN(w_current,
- o_current->picture->upper_x, o_current->picture->upper_y,
- &screen_x1, &screen_y1);
- o_current->picture->screen_upper_x = screen_x1;
- o_current->picture->screen_upper_y = screen_y1;
-
- /* update the screen coords of the lower right corner of the picture */
- WORLDtoSCREEN(w_current,
- o_current->picture->lower_x, o_current->picture->lower_y,
- &screen_x2, &screen_y2);
- o_current->picture->screen_lower_x = screen_x2;
- o_current->picture->screen_lower_y = screen_y2;
-
- /* update the bounding picture - screen unit */
- get_picture_bounds(w_current, o_current->picture,
+ /* update the bounding picture - world units */
+ world_get_picture_bounds(w_current, o_current->picture,
&left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
1.24.2.6 +23 -95 eda/geda/gaf/libgeda/src/o_pin_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_pin_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_pin_basic.c,v
retrieving revision 1.24.2.5
retrieving revision 1.24.2.6
diff -u -b -r1.24.2.5 -r1.24.2.6
--- o_pin_basic.c 25 Feb 2007 13:29:27 -0000 1.24.2.5
+++ o_pin_basic.c 25 Feb 2007 13:41:25 -0000 1.24.2.6
@@ -94,7 +94,6 @@
char type, int color,
int x1, int y1, int x2, int y2, int pin_type, int whichend)
{
- int screen_x, screen_y;
int left, right, top, bottom;
OBJECT *new_node;
@@ -109,28 +108,12 @@
new_node->line->x[1] = x2;
new_node->line->y[1] = y2;
- WORLDtoSCREEN(w_current,
- new_node->line->x[0], new_node->line->y[0],
- &screen_x,
- &screen_y);
+ world_get_pin_bounds(w_current, new_node->line, &left, &top, &right, &bottom);
- new_node->line->screen_x[0] = screen_x;
- new_node->line->screen_y[0] = screen_y;
-
- WORLDtoSCREEN(w_current,
- new_node->line->x[1], new_node->line->y[1],
- &screen_x,
- &screen_y);
-
- new_node->line->screen_x[1] = screen_x;
- new_node->line->screen_y[1] = screen_y;
-
- get_pin_bounds(w_current, new_node->line, &left, &top, &right, &bottom);
-
- new_node->left = left;
- new_node->top = top;
- new_node->right = right;
- new_node->bottom = bottom;
+ new_node->w_left = left;
+ new_node->w_top = top;
+ new_node->w_right = right;
+ new_node->w_bottom = bottom;
new_node->draw_func = pin_draw_func;
new_node->sel_func = select_func;
@@ -172,37 +155,18 @@
*/
void o_pin_recalc(TOPLEVEL *w_current, OBJECT *o_current)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (o_current->line == NULL) {
return;
}
+ world_get_pin_bounds(w_current, o_current->line, &left, &top, &right, &bottom);
- WORLDtoSCREEN(w_current, o_current->line->x[0],
- o_current->line->y[0],
- &screen_x1,
- &screen_y1);
-
- o_current->line->screen_x[0] = screen_x1;
- o_current->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, o_current->line->x[1],
- o_current->line->y[1],
- &screen_x2,
- &screen_y2);
-
- o_current->line->screen_x[1] = screen_x2;
- o_current->line->screen_y[1] = screen_y2;
-
- get_pin_bounds(w_current, o_current->line, &left, &top, &right, &bottom);
-
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
@@ -310,43 +274,24 @@
*/
void o_pin_translate_world(TOPLEVEL *w_current, int x1, int y1, OBJECT *object)
{
- int screen_x1, screen_y1;
- int screen_x2, screen_y2;
int left, right, top, bottom;
if (object == NULL) printf("ptw NO!\n");
- /* Do world coords */
+ /* Update world coords */
object->line->x[0] = object->line->x[0] + x1;
object->line->y[0] = object->line->y[0] + y1;
object->line->x[1] = object->line->x[1] + x1;
object->line->y[1] = object->line->y[1] + y1;
- /* update screen coords */
- WORLDtoSCREEN(w_current, object->line->x[0],
- object->line->y[0],
- &screen_x1,
- &screen_y1);
-
- object->line->screen_x[0] = screen_x1;
- object->line->screen_y[0] = screen_y1;
-
- WORLDtoSCREEN(w_current, object->line->x[1],
- object->line->y[1],
- &screen_x2,
- &screen_y2);
-
- object->line->screen_x[1] = screen_x2;
- object->line->screen_y[1] = screen_y2;
-
- /* update bounding box */
- get_pin_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ /* Update bounding box */
+ world_get_pin_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
@@ -373,14 +318,6 @@
o_current->line->x[1], o_current->line->y[1],
o_current->pin_type, o_current->whichend);
- /* why is this here ? */
- /* because they all have it, and it is used during outline actions */
- new_obj->line->screen_x[0] = o_current->line->screen_x[0];
- new_obj->line->screen_y[0] = o_current->line->screen_y[0];
- new_obj->line->screen_x[1] = o_current->line->screen_x[1];
- new_obj->line->screen_y[1] = o_current->line->screen_y[1];
-
-
new_obj->line->x[0] = o_current->line->x[0];
new_obj->line->y[0] = o_current->line->y[0];
new_obj->line->x[1] = o_current->line->x[1];
@@ -540,26 +477,17 @@
void o_pin_modify(TOPLEVEL *w_current, OBJECT *object,
int x, int y, int whichone)
{
- int screen_x, screen_y;
int left, right, top, bottom;
object->line->x[whichone] = x;
object->line->y[whichone] = y;
- WORLDtoSCREEN(w_current,
- object->line->x[whichone],
- object->line->y[whichone],
- &screen_x, &screen_y);
-
- object->line->screen_x[whichone] = screen_x;
- object->line->screen_y[whichone] = screen_y;
-
- get_pin_bounds(w_current, object->line, &left, &top, &right, &bottom);
-
- object->left = left;
- object->top = top;
- object->right = right;
- object->bottom = bottom;
+ world_get_pin_bounds(w_current, object->line, &left, &top, &right, &bottom);
+
+ object->w_left = left;
+ object->w_top = top;
+ object->w_right = right;
+ object->w_bottom = bottom;
s_tile_update_object(w_current, object);
}
1.25.2.5 +22 -36 eda/geda/gaf/libgeda/src/o_text_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_text_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_text_basic.c,v
retrieving revision 1.25.2.4
retrieving revision 1.25.2.5
diff -u -b -r1.25.2.4 -r1.25.2.5
--- o_text_basic.c 25 Feb 2007 13:36:58 -0000 1.25.2.4
+++ o_text_basic.c 25 Feb 2007 13:41:25 -0000 1.25.2.5
@@ -78,10 +78,10 @@
* \par Function Description
*
*/
-void world_get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current, int *left,
+int world_get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current, int *left,
int *top, int *right, int *bottom)
{
- world_get_complex_bounds(w_current, o_current->text->prim_objs,
+ return world_get_object_list_bounds(w_current, o_current->text->prim_objs,
left, top, right, bottom);
}
@@ -907,7 +907,6 @@
text->alignment = alignment;
text->x = x;
text->y = y;
- WORLDtoSCREEN(w_current, x, y, &text->screen_x, &text->screen_y);
text->angle = angle;
new_node->text = text;
@@ -990,13 +989,13 @@
w_current->page_current->object_parent = temp_parent;
- get_text_bounds(w_current, object_list, &left, &top, &right, &bottom);
+ world_get_text_bounds(w_current, object_list, &left, &top, &right, &bottom);
/* set the new object's bounding box */
- object_list->left = left;
- object_list->top = top;
- object_list->right = right;
- object_list->bottom = bottom;
+ object_list->w_left = left;
+ object_list->w_top = top;
+ object_list->w_right = right;
+ object_list->w_bottom = bottom;
if (name) g_free(name);
if (value) g_free(value);
@@ -1017,17 +1016,13 @@
return;
}
- get_object_list_bounds(w_current, o_current->text->prim_objs,
+ world_get_object_list_bounds(w_current, o_current->text->prim_objs,
&left, &top, &right, &bottom);
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
- WORLDtoSCREEN(w_current, o_current->text->x,
- o_current->text->y,
- &o_current->text->screen_x,
- &o_current->text->screen_y);
}
/*! \todo Finish function documentation!!!
@@ -1374,30 +1369,21 @@
void o_text_translate_world(TOPLEVEL *w_current,
int x1, int y1, OBJECT *o_current)
{
- int screen_x, screen_y;
int left, right, top, bottom;
o_current->text->x = o_current->text->x + x1;
o_current->text->y = o_current->text->y + y1;
- /* update screen coords */
- WORLDtoSCREEN(w_current, o_current->text->x, o_current->text->y,
- &screen_x, &screen_y);
-
- o_current->text->screen_x = screen_x;
- o_current->text->screen_y = screen_y;
-
o_complex_world_translate(w_current, x1, y1, o_current->text->prim_objs);
- /* update bounding box */
- /* do it */
- get_text_bounds(w_current, o_current, &left, &top, &right, &bottom);
-
- o_current->left = left;
- o_current->top = top;
- o_current->right = right;
- o_current->bottom = bottom;
+ /* Update bounding box */
+ world_get_text_bounds(w_current, o_current, &left, &top, &right, &bottom);
+
+ o_current->w_left = left;
+ o_current->w_top = top;
+ o_current->w_right = right;
+ o_current->w_bottom = bottom;
}
/*! \todo Finish function documentation!!!
1.25.2.1 +4 -10 eda/geda/gaf/libgeda/src/s_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/s_basic.c,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -b -r1.25 -r1.25.2.1
--- s_basic.c 17 Dec 2006 04:14:07 -0000 1.25
+++ s_basic.c 25 Feb 2007 13:41:25 -0000 1.25.2.1
@@ -169,10 +169,10 @@
sprintf(new_node->name, "%s.%d", name, new_node->sid);
/* Setup the bounding box */
- new_node->top = 999999;
- new_node->left = 999999;
- new_node->right = 0;
- new_node->bottom = 0;
+ new_node->w_top = 0;
+ new_node->w_left = 0;
+ new_node->w_right = 0;
+ new_node->w_bottom = 0;
/* Setup line/circle structs */
new_node->line = NULL;
@@ -209,19 +209,13 @@
new_node->line_end = END_NONE;
new_node->line_type = TYPE_SOLID;
new_node->line_width = 0;
- new_node->screen_line_width = 0;
new_node->line_space = 0;
- new_node->screen_line_space = 0;
new_node->line_length = 0;
- new_node->screen_line_length = 0;
new_node->fill_width = 0;
- new_node->screen_fill_width = 0;
new_node->fill_angle1 = 0;
new_node->fill_angle2 = 0;
new_node->fill_pitch1 = 0;
- new_node->screen_fill_pitch1 = 0;
new_node->fill_pitch2 = 0;
- new_node->screen_fill_pitch2 = 0;
new_node->attribs = NULL;
new_node->attached_to = NULL;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs