diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-04 19:06:34 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-04 19:06:34 +0000 |
| commit | 06b346c6b592e8a0d9609e42c5a509ee9ebe519b (patch) | |
| tree | d11771089b02bc74843859851025824a6d8ac3b9 /src/dialogs/unclump.cpp | |
| parent | replace use of invokeBbox in flood fill tool (diff) | |
| download | inkscape-06b346c6b592e8a0d9609e42c5a509ee9ebe519b.tar.gz inkscape-06b346c6b592e8a0d9609e42c5a509ee9ebe519b.zip | |
adapt code to new Maybe/bbox regime
(bzr r2538)
Diffstat (limited to 'src/dialogs/unclump.cpp')
| -rw-r--r-- | src/dialogs/unclump.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/dialogs/unclump.cpp b/src/dialogs/unclump.cpp index f067aef5f..a15e17bc7 100644 --- a/src/dialogs/unclump.cpp +++ b/src/dialogs/unclump.cpp @@ -34,10 +34,15 @@ unclump_center (SPItem *item) return i->second; } - NR::Rect const r = item->getBounds(sp_item_i2d_affine(item)); - NR::Point const c = r.midpoint(); - c_cache[SP_OBJECT_ID(item)] = c; - return c; + NR::Maybe<NR::Rect> r = item->getBounds(sp_item_i2d_affine(item)); + if (r) { + NR::Point const c = r->midpoint(); + c_cache[SP_OBJECT_ID(item)] = c; + return c; + } else { + // FIXME + return NR::Point(0, 0); + } } NR::Point @@ -48,9 +53,13 @@ unclump_wh (SPItem *item) if ( i != wh_cache.end() ) { wh = i->second; } else { - NR::Rect const r = item->getBounds(sp_item_i2d_affine(item)); - wh = r.dimensions(); - wh_cache[SP_OBJECT_ID(item)] = wh; + NR::Maybe<NR::Rect> r = item->getBounds(sp_item_i2d_affine(item)); + if (r) { + wh = r->dimensions(); + wh_cache[SP_OBJECT_ID(item)] = wh; + } else { + wh = NR::Point(0, 0); + } } return wh; |
