~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/selection.cpp

  • Committer: Ted Gould
  • Date: 2008-11-21 05:24:08 UTC
  • Revision ID: ted@canonical.com-20081121052408-tilucis2pjrrpzxx
MergeĀ fromĀ fe-moved

Show diffs side-by-side

added added

removed removed

Lines of Context:
383
383
    return bbox;
384
384
}
385
385
 
386
 
boost::optional<Geom::Rect> Selection::bounds(SPItem::BBoxType type) const
 
386
Geom::OptRect Selection::bounds(SPItem::BBoxType type) const
387
387
{
388
388
    GSList const *items = const_cast<Selection *>(this)->itemList();
389
389
 
390
 
    boost::optional<Geom::Rect> bbox;
 
390
    Geom::OptRect bbox;
391
391
    for ( GSList const *i = items ; i != NULL ; i = i->next ) {
392
392
        bbox = unify(bbox, sp_item_bbox_desktop(SP_ITEM(i->data), type));
393
393
    }
415
415
    return bbox;
416
416
}
417
417
 
418
 
boost::optional<Geom::Rect> Selection::boundsInDocument(SPItem::BBoxType type) const {
 
418
Geom::OptRect Selection::boundsInDocument(SPItem::BBoxType type) const {
419
419
    NRRect r;
420
420
    return to_2geom(boundsInDocument(&r, type)->upgrade());
421
421
}
430
430
            return first->getCenter();
431
431
        }
432
432
    }
433
 
    boost::optional<Geom::Rect> bbox = bounds();
 
433
    Geom::OptRect bbox = bounds();
434
434
    if (bbox) {
435
435
        return bounds()->midpoint();
436
436
    } else {
479
479
            cvh.add(*i);
480
480
        }
481
481
 
482
 
        boost::optional<Geom::Rect> rHull = cvh.bounds();
 
482
        Geom::OptRect rHull = cvh.bounds();
483
483
        if (rHull) {
484
484
            for ( unsigned i = 0 ; i < 4 ; ++i ) {
485
485
                pHull.push_back(rHull->corner(i));