summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/selection.cpp14
1 files changed, 6 insertions, 8 deletions
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<Geom::Point> 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 {