From deb1727d4b7dfdfe9c68fb8a3ae6736d8e90d3c3 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 31 Oct 2013 12:39:40 -0400 Subject: Remove warning on bbox and allow empty bound selection to clear existing selection. Fixed bugs: - https://launchpad.net/bugs/1243408 (bzr r12755) --- src/selection.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index aea5f539c..7c696daf0 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -237,8 +237,11 @@ void Selection::_remove(SPObject *obj) { } void Selection::setList(GSList const *list) { - _clear(); - addList(list); + // Clear and add, or just clear with emit. + if (list != NULL) { + _clear(); + addList(list); + } else clear(); } void Selection::addList(GSList const *list) { @@ -444,12 +447,7 @@ boost::optional Selection::center() const { return first->getCenter(); } } - Geom::OptRect bbox; - if (Inkscape::Preferences::get()->getInt("/tools/bounding_box") == 0) { - bbox = visualBounds(); - } else{ - bbox = geometricBounds(); - } + Geom::OptRect bbox = preferredBounds(); if (bbox) { return bbox->midpoint(); } else { -- cgit v1.2.3