Logo Search packages:      
Sourcecode: inkscape version File versions

NRRect * SPSelection::boundsInDocument ( NRRect *  dest  )  const

Returns the bounding rectangle of the selection.

TODO: how is this different from bounds()?

Definition at line 321 of file selection.cpp.

References itemList(), and sp_item_i2doc_affine().

                                                        {
    g_return_val_if_fail (bbox != NULL, NULL);

    GSList const *items=const_cast<SPSelection *>(this)->itemList();
    if (!items) {
        bbox->x0 = bbox->y0 = bbox->x1 = bbox->y1 = 0.0;
        return bbox;
    }

    bbox->x0 = bbox->y0 = 1e18;
    bbox->x1 = bbox->y1 = -1e18;

    for ( GSList const *iter=items ; iter != NULL ; iter = iter->next ) {
        SPItem *item=SP_ITEM(iter->data);
        NR::Matrix const i2doc(sp_item_i2doc_affine(item));
        sp_item_invoke_bbox(item, bbox, i2doc, FALSE);
    }

    return bbox;
}


Generated by  Doxygen 1.6.0   Back to index