[Kst] branches/work/kst/viewpaint/kst/kst

George Staikos staikos at kde.org
Sun Jan 29 23:15:39 CET 2006


SVN commit 503689 by staikos:

preserving position of children relative to the contents rect is implemented,
but for some reason doesn't update when resizing the parent, only when moving
it.


 M  +1 -4      kst2dplot.cpp  
 M  +3 -3      kstviewobject.cpp  


--- branches/work/kst/viewpaint/kst/kst/kst2dplot.cpp #503688:503689
@@ -6550,10 +6550,7 @@
 
 
 QRect Kst2DPlot::contentsRect() const {
-  return QRect(PlotRegion.left() + geometry().left(),
-               PlotRegion.top() + geometry().top(),
-               PlotRegion.width(),
-               PlotRegion.height());
+  return PlotRegion;
 }
 
 namespace {
--- branches/work/kst/viewpaint/kst/kst/kstviewobject.cpp #503688:503689
@@ -1285,7 +1285,7 @@
 void KstViewObject::updateFromAspect() {
   setMinimumSize(minimumSize().expandedTo(QSize(_children.count(), _children.count())));
   if (_parent) {
-    const QRect geom(_parent->geometry());
+    const QRect geom(_parent->contentsRect());
     _geom.setLeft(geom.left() + int(_aspect.x * geom.width()));
     _geom.setTop(geom.top() + int(_aspect.y * geom.height()));
     _geom.setRight(geom.left() + int((_aspect.x + _aspect.w) * geom.width()) - 1);
@@ -1301,7 +1301,7 @@
 
 void KstViewObject::updateAspectPos() {
   if (_parent) {
-    const QRect geom(_parent->geometry());
+    const QRect geom(_parent->contentsRect());
     _aspect.x = double(geometry().left() - geom.left()) / double(geom.width());
     _aspect.y = double(geometry().top() - geom.top()) / double(geom.height());
   } else {
@@ -1313,7 +1313,7 @@
 
 void KstViewObject::updateAspectSize() {
   if (_parent) {
-    const QRect geom(_parent->geometry());
+    const QRect geom(_parent->contentsRect());
     _aspect.w = double(geometry().width()) / double(geom.width());
     _aspect.h = double(geometry().height()) / double(geom.height());
   } else {


More information about the Kst mailing list