[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Thu Apr 6 06:18:36 CEST 2006


SVN commit 526966 by staikos:

don't break plot groups apart.  There are still many problems lurking though.
BUG: 124453


 M  +6 -4      ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #526965:526966
@@ -330,11 +330,13 @@
   _pressTarget = findDeepestChild(pos, false);
   if (_pressTarget) {
     KstViewObjectPtr p = _pressTarget;
-    while (p->_parent && p->_parent->_container) {
+    while (p->_parent && (p->_parent->_container || kst_cast<KstPlotGroup>((KstViewObjectPtr)p->_parent)) && !kst_cast<KstTopLevelView>((KstViewObjectPtr)p->_parent)) {
       p = p->_parent;
     }
-    if (p->_parent && !p->_parent->_container) {
+    if (p->_parent && !p->_parent->_container && !kst_cast<KstTopLevelView>((KstViewObjectPtr)p->_parent)) {
       _pressTarget = p->_parent;
+    } else if (p && !p->_container) {
+      _pressTarget = p;
     }
   }
 
@@ -957,10 +959,10 @@
       obj = obj.unite((*i)->geometry());
     } 
   }
-  const QPoint objOffset(_pressTarget->geometry().topLeft() - obj.topLeft());
+  const QPoint objOffset(old.topLeft() - obj.topLeft());
 
   // do the move
-  obj.moveTopLeft(pos - _moveOffset - _moveOffsetSticky - _pressTarget->geometry().topLeft() + obj.topLeft());
+  obj.moveTopLeft(pos - _moveOffset - _moveOffsetSticky - old.topLeft() + obj.topLeft());
   if (!_geom.contains(obj, true)) {
     slideInto(_geom, obj);
   }


More information about the Kst mailing list