diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 1d4557b903fa60e7bad1e0b7780ce3ba0a9a5cb7..b41ee1d5c6374399c4552c7c69ac600d4a131b19 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
}
if (!_center_is_set) {
- // Extract the position of the center from the first selected object
- GSList *items = (GSList *) _desktop->selection->itemList();
- if (items) {
- SPItem *first = reinterpret_cast<SPItem*>(g_slist_last(items)->data); // from the first item in selection
- if (first->isCenterSet()) { // only if set explicitly
- _center = first->getCenter();
- } else {
- _center = _box.midpoint();
- }
- } else {
- _center = _box.midpoint();
- }
+ _center = _desktop->selection->center();
_center_is_set = true;
}