index 64c348be5a9fcde4bb9b7ebe066a315910438a08..eb5870d2eb77f51dea44c9dcc4e2c7451862f784 100644 (file)
--- a/src/dialogs/unclump.cpp
+++ b/src/dialogs/unclump.cpp
*/
+#include <algorithm>
#include <map>
#include "libnr/nr-matrix-ops.h"
#include "sp-item.h"
return i->second;
}
- NR::Rect const r = item->invokeBbox(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
if ( i != wh_cache.end() ) {
wh = i->second;
} else {
- NR::Rect const r = item->invokeBbox(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;