Bug 115893

Summary: Alignment is broken with groups
Product: [Applications] kst Reporter: George Staikos <staikos>
Component: plottingAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description George Staikos 2005-11-08 04:29:49 UTC
Alignment of axes is broken when plots are grouped.  The axes don't properly 
take the tick labels into account and cause overlap of labels.  For example in 
demo.kst, group the top two plots and notice the text overlap.
Comment 1 Andrew Walker 2005-12-01 19:57:00 UTC
SVN commit 484745 by arwalker:

BUG:115893 Ensure axis alignment occurs across groups by burrowing down into groups to determine the axis alignment and dirty states.

 M  +5 -6      ksttoplevelview.cpp  
 M  +8 -0      kstviewobject.cpp  


--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #484744:484745
@@ -112,11 +112,8 @@
     //        X11 triggered event in that case, since we already iterate.
     //        Also this might break if a draw happens before this is called,
     //        which was at least the case at one time in the past.
-    for (KstViewObjectList::ConstIterator i = _children.begin(); i != _children.end(); ++i) {
-      if ((*i)->dirty()) {
-        updateAlignment(p);
-        break;
-      }
+    if (objectDirty()) {
+      updateAlignment(p);
     }
   }
 #ifdef BENCHMARK
@@ -143,7 +140,9 @@
   KST::alignment.reset();  
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     (*i)->internalAlignment(p, plotRegion);
-    KST::alignment.setPosition((*i)->geometry(), plotRegion);
+    if (!plotRegion.isNull()) {
+      KST::alignment.setPosition((*i)->geometry(), plotRegion);
+    }
   }
 }
 
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #484744:484745
@@ -544,6 +544,14 @@
 void KstViewObject::internalAlignment(KstPainter& p, QRect& plotRegion) {
   Q_UNUSED(p)
   static const QRect x(0,0,0,0);
+
+  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+    (*i)->internalAlignment(p, plotRegion);
+    if (!plotRegion.isNull()) {
+      KST::alignment.setPosition((*i)->geometry(), plotRegion);
+    }
+  }
+  
   plotRegion = x;
 }
 
Comment 2 Peter Kümmel 2010-08-14 14:40:49 UTC
Change version to 1.x