Code

use rotation center in keyboard rotation and transform dialog
[inkscape.git] / src / seltrans.cpp
index 1d4557b903fa60e7bad1e0b7780ce3ba0a9a5cb7..b41ee1d5c6374399c4552c7c69ac600d4a131b19 100644 (file)
@@ -480,18 +480,7 @@ void Inkscape::SelTrans::_updateHandles()
     }
 
     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;
     }