summaryrefslogtreecommitdiffstats
path: root/src/selection.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2013-10-31 16:39:40 +0000
committerMartin Owens <doctormo@gmail.com>2013-10-31 16:39:40 +0000
commitdeb1727d4b7dfdfe9c68fb8a3ae6736d8e90d3c3 (patch)
tree82118aec5a27164796a87879c05ada34d49b43bd /src/selection.cpp
parentPartially fix crashes when entering a group with deleted id (diff)
downloadinkscape-deb1727d4b7dfdfe9c68fb8a3ae6736d8e90d3c3.tar.gz
inkscape-deb1727d4b7dfdfe9c68fb8a3ae6736d8e90d3c3.zip
Remove warning on bbox and allow empty bound selection to clear existing selection.
Fixed bugs: - https://launchpad.net/bugs/1243408 (bzr r12755)
Diffstat (limited to '')
-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 {