[Kst] branches/work/kst/portto4/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Wed Jan 20 02:26:47 CET 2010


SVN commit 1077363 by netterfield:

Don't let the right side of the plot bounce around with live data...
(Don't expand the right axis to fit large labels.  Dump the label instead.)



 M  +10 -11    plotitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1077362:1077363
@@ -1091,13 +1091,16 @@
       }
     }
 
-    if (rect().left() > bound.left()) bound.setLeft(rect().left());
-    if (rect().right() < bound.right()) bound.setRight(rect().right());
+    if (rect().left() > bound.left()) {
+      bound.setLeft(rect().left());
+    }
 
-    CachedPlotLabel label;
-    label.bound = bound;
-    label.value = xLabelIt.value();
-    _xPlotLabels.append(label);
+    if (rect().right() >= bound.right()) { // if no overflow to the right...
+      CachedPlotLabel label;
+      label.bound = bound;
+      label.value = xLabelIt.value();
+      _xPlotLabels.append(label);
+    }
   }
   painter->restore();
 
@@ -2433,11 +2436,7 @@
   }
 
   _calculatedAxisMarginHeight = xLabelRect.height();
-  if (xLabelRect.right() > plotRect().right()) {
-    _calculatedAxisMarginROverflow = qMax(ViewItem::sizeOfGrip().width(), xLabelRect.right() - plotRect().right());
-  } else {
-    _calculatedAxisMarginROverflow = ViewItem::sizeOfGrip().width();
-  }
+  _calculatedAxisMarginROverflow = 2*ViewItem::sizeOfGrip().width();
 
   painter->restore();
 }


More information about the Kst mailing list