diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index fbceb4eb5467096df8a220045e8c4af010aa4ef3..864eadbbab51a52b1036dcca4f2959e5970da4f3 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
_transformed_connection.disconnect();
if (new_setting) {
- _transformed_connection = item->connectTransformed(
- sigc::ptr_fun(&avoid_item_move));
-
Avoid::Polygn poly = avoid_item_poly(item);
if (poly.pn > 0) {
+ _transformed_connection = item->connectTransformed(
+ sigc::ptr_fun(&avoid_item_move));
+
const char *id = SP_OBJECT_REPR(item)->attribute("id");
g_assert(id != NULL);
// some convex hull code, though not NR::ConvexHull as this
// only keeps the bounding box of the convex hull currently.
- // TODO: SPItem::invokeBbox gives the wrong result for some objects
+ // TODO: SPItem::getBounds gives the wrong result for some objects
// that have internal representations that are updated later
// by the sp_*_update functions, e.g., text.
sp_document_ensure_up_to_date(item->document);
- NR::Rect rHull = item->invokeBbox(sp_item_i2doc_affine(item));
-
+ NR::Maybe<NR::Rect> rHull = item->getBounds(sp_item_i2doc_affine(item));
+ if (!rHull) {
+ return Avoid::newPoly(0);
+ }
double spacing = desktop->namedview->connector_spacing;
// Add a little buffer around the edge of each object.
- NR::Rect rExpandedHull = NR::expand(rHull, -spacing);
+ NR::Rect rExpandedHull = NR::expand(*rHull, -spacing);
poly = Avoid::newPoly(4);
for (unsigned n = 0; n < 4; ++n) {