Bug 121060 - Maximize mode no longer working
Summary: Maximize mode no longer working
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: view objects (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-30 20:51 UTC by Andrew Walker
Modified: 2006-01-31 05:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch (2.00 KB, patch)
2006-01-31 04:18 UTC, George Staikos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2006-01-30 20:51:59 UTC
Version:           HEAD (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
When a plot is maximized it is not painted correctly

STEPS TO REPRODUCE:
Start Kst
Create a window and create 3 plots within it
Maximize one the plots

RESULTS:
The plot is not drawn, but flickers continually
if in datamode and the mouse is moved.

EXPECTED RESULTS:
The plot is drawn normally.
Comment 1 George Staikos 2006-01-31 04:18:03 UTC
Created attachment 14464 [details]
Patch

Attached patch to fix the problem.  The maximized case didn't get updated on
one of my iterations of redesign.
Comment 2 Netterfield 2006-01-31 05:34:34 UTC
Please commit.

cbn

On January 30, 2006 07:18 pm, George Staikos wrote:
[bugs.kde.org quoted mail]
Comment 3 George Staikos 2006-01-31 05:37:13 UTC
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