From a99764de718f7331615d3f9449e10a56dee62fb6 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sat, 10 Mar 2007 20:54:38 +0000 Subject: Merge further bbox work (bzr r2596) --- src/connector-context.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/connector-context.cpp') diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 367917915..89d38bace 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -1145,12 +1145,14 @@ static void cc_set_active_shape(SPConnectorContext *cc, SPItem *item) } - NR::Rect bbox = sp_item_bbox_desktop(cc->active_shape); - NR::Point center = bbox.midpoint(); - sp_knot_set_position(cc->connpthandle, ¢er, 0); - - sp_knot_show(cc->connpthandle); - + NR::Maybe bbox = sp_item_bbox_desktop(cc->active_shape); + if (bbox) { + NR::Point center = bbox->midpoint(); + sp_knot_set_position(cc->connpthandle, ¢er, 0); + sp_knot_show(cc->connpthandle); + } else { + sp_knot_hide(cc->connpthandle); + } } -- cgit v1.2.3