summaryrefslogtreecommitdiffstats
path: root/src/connector-context.cpp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2007-03-10 20:54:38 +0000
committermental <mental@users.sourceforge.net>2007-03-10 20:54:38 +0000
commita99764de718f7331615d3f9449e10a56dee62fb6 (patch)
treed60bc8389777a4384b8c931867a93c6491fffee5 /src/connector-context.cpp
parentfix setting knot->pos for node handles, but remove coords updating - now done... (diff)
downloadinkscape-a99764de718f7331615d3f9449e10a56dee62fb6.tar.gz
inkscape-a99764de718f7331615d3f9449e10a56dee62fb6.zip
Merge further bbox work
(bzr r2596)
Diffstat (limited to 'src/connector-context.cpp')
-rw-r--r--src/connector-context.cpp14
1 files changed, 8 insertions, 6 deletions
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, &center, 0);
-
- sp_knot_show(cc->connpthandle);
-
+ NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop(cc->active_shape);
+ if (bbox) {
+ NR::Point center = bbox->midpoint();
+ sp_knot_set_position(cc->connpthandle, &center, 0);
+ sp_knot_show(cc->connpthandle);
+ } else {
+ sp_knot_hide(cc->connpthandle);
+ }
}