Bug 115893 - Alignment is broken with groups
Summary: Alignment is broken with groups
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: plotting (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-08 04:29 UTC by George Staikos
Modified: 2010-08-14 14:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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