[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Tue Jan 31 05:37:08 CET 2006


SVN commit 504020 by staikos:

Fix maximize after view object painting patch.
BUG: 121060


 M  +19 -18    kstviewobject.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #504019:504020
@@ -340,7 +340,7 @@
   // handle the case where we have maximized plots
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     if ((*i)->_maximized) {
-      (*i)->paint(p, bounds);
+      (*i)->paintSelf(p, bounds);
       maximized = true;
       break;
     }
@@ -352,31 +352,32 @@
   } else {
     clipRegion = bounds;
   }
-  if (!maximized && !_children.isEmpty()) {
-    KstViewObjectList::Iterator begin = _children.begin();
-    for (KstViewObjectList::Iterator i = _children.fromLast();; --i) {
-      const QRegion thisObjectGeometry((*i)->geometry());
-      if (nullBounds || !clipRegion.intersect(thisObjectGeometry).isEmpty()) {
+  if (!maximized) {
+    if (!_children.isEmpty()) {
+      KstViewObjectList::Iterator begin = _children.begin();
+      for (KstViewObjectList::Iterator i = _children.fromLast();; --i) {
+        const QRegion thisObjectGeometry((*i)->geometry());
+        if (nullBounds || !clipRegion.intersect(thisObjectGeometry).isEmpty()) {
 #ifdef BENCHMARK
-        QTime t;
-        t.start();
+          QTime t;
+          t.start();
 #endif
-        (*i)->paint(p, clipRegion);
-        clipRegion -= (*i)->clipRegion();
+          (*i)->paint(p, clipRegion);
+          clipRegion -= (*i)->clipRegion();
 #ifdef BENCHMARK
-        int x = t.elapsed();
-        kstdDebug() << "   -> object " << (*i)->tagName() << " took " << x << "ms" << endl;
+          int x = t.elapsed();
+          kstdDebug() << "   -> object " << (*i)->tagName() << " took " << x << "ms" << endl;
 #endif
+        }
+        if (i == begin) {
+          break;
+        }
       }
-      if (i == begin) {
-        break;
-      }
     }
+    // Paint ourself
+    paintSelf(p, clipRegion - p.uiMask());
   }
 
-  // Paint ourself
-  paintSelf(p, clipRegion - p.uiMask());
-
   p.restore();
 
   // Draw any inline UI items


More information about the Kst mailing list