[Kst] branches/kst/1.2/kst/kst

George Staikos staikos at kde.org
Thu Mar 30 16:14:51 CEST 2006


SVN commit 524423 by staikos:

backport: fix maximized drawing and painting


 M  +15 -5     kstviewobject.cpp  


--- branches/kst/1.2/kst/kst/kstviewobject.cpp #524422:524423
@@ -295,11 +295,23 @@
 
 
 void KstViewObject::paint(KstPainter& p, const QRegion& bounds) {
+  bool maximized = false;
   if (p.type() == KstPainter::P_EXPORT || p.type() == KstPainter::P_PRINT) {
-    paintSelf(p, bounds);
+    // handle the case where we have maximized plots
     for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
-      (*i)->paint(p, bounds);
+      if ((*i)->_maximized) {
+        (*i)->paint(p, bounds);
+        maximized = true;
+        break;
+      }
     }
+
+    if (!maximized) {
+      paintSelf(p, bounds);
+      for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+        (*i)->paint(p, bounds);
+      }
+    }
     return;
   }
 
@@ -315,14 +327,12 @@
   }
   paintUpdate();
 
-  bool maximized = false;
   bool nullBounds = bounds.isNull();
 
   // handle the case where we have maximized plots
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     if ((*i)->_maximized) {
-      (*i)->updateSelf();
-      (*i)->paintSelf(p, bounds);
+      (*i)->paint(p, bounds);
       maximized = true;
       break;
     }


More information about the Kst mailing list