Logo Search packages:      
Sourcecode: inkscape version File versions

Geom::Point unclump_center ( SPItem item  ) 

Center of bbox of item

Definition at line 27 of file unclump.cpp.

References SPItem::getBounds(), and sp_item_i2d_affine().

Referenced by unclump_dist(), unclump_pull(), unclump_push(), and unclump_remove_behind().

{
    std::map<const gchar *, Geom::Point>::iterator i = c_cache.find(SP_OBJECT_ID(item));
    if ( i != c_cache.end() ) {
        return i->second;
    }

    Geom::OptRect r = item->getBounds(sp_item_i2d_affine(item));
    if (r) {
      Geom::Point const c = r->midpoint();
      c_cache[SP_OBJECT_ID(item)] = c;
        return c; 
    } else {
      // FIXME
        return Geom::Point(0, 0);
    }
}


Generated by  Doxygen 1.6.0   Back to index