Ejemplo n.º 1
0
/*! \brief Calculate the bounds of a box
 *
 *  Calculates the bounds of a box with zero line width.
 *
 *  If this function fails, the bounds will be set to empty.
 *
 *  \param [in] box the circle
 *  \param [out] bounds the bounds of the box
 */
void
geda_box_calculate_bounds (const GedaBox *box, GedaBounds *bounds)
{
  if (box == NULL) {
    geda_bounds_init (bounds);
    g_return_if_fail (box != NULL);
  }

  geda_bounds_init_with_points (bounds,
                                box->lower_x,
                                box->lower_y,
                                box->upper_x,
                                box->upper_y);
}
Ejemplo n.º 2
0
/*! \brief Get picture bounding rectangle in WORLD coordinates.
 *
 *  On failure, this function sets the bounds to empty.
 *
 *  \param [in]  toplevel  Unused
 *  \param [in]  object    Picture OBJECT to read coordinates from.
 *  \param [out] bounds    The bounds of the picture
 */
void
geda_picture_object_calculate_bounds (TOPLEVEL *toplevel,
                                      const OBJECT *object,
                                      GedaBounds *bounds)
{
  geda_bounds_init (bounds);

  g_return_if_fail (object != NULL);
  g_return_if_fail (object->type == OBJ_PICTURE);
  g_return_if_fail (object->picture != NULL);

  geda_bounds_init_with_points (bounds,
                                object->picture->lower_x,
                                object->picture->lower_y,
                                object->picture->upper_x,
                                object->picture->upper_y);
}