X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdialogs%2Funclump.cpp;h=eb5870d2eb77f51dea44c9dcc4e2c7451862f784;hb=569ef8f6dbacc8a8b0b933d02a806c2e091ce02b;hp=f067aef5f85601ca55833f6f857fe7e964602afb;hpb=b949b7ecee708059c921bb8afdd1c5461026bc66;p=inkscape.git diff --git a/src/dialogs/unclump.cpp b/src/dialogs/unclump.cpp index f067aef5f..eb5870d2e 100644 --- a/src/dialogs/unclump.cpp +++ b/src/dialogs/unclump.cpp @@ -11,6 +11,7 @@ */ +#include #include #include "libnr/nr-matrix-ops.h" #include "sp-item.h" @@ -34,10 +35,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 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 +54,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 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;