[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kst/portto4/kst/src/libkstapp
From:       Barth Netterfield <netterfield () astro ! utoronto ! ca>
Date:       2012-07-10 0:26:39
Message-ID: 20120710002639.AE728AC7A9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1304951 by netterfield:

A hacky heuristic to guess the right width of the widest number for very
small scientific notation numbers.  This is not exact but seems to work.


 M  +8 -1      plotitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1304950:1304951
@@ -2564,7 +2564,14 @@
     while (yLabelIt.hasNext()) {
       yLabelIt.next();
 
-      QRectF bound = painter->boundingRect(QRectF(), flags, yLabelIt.value());
+      // a hacky heuristic to guess the right width of the widest number for very \
small scientific notation numbers. +      // 'label' is only used to find its width.  \
This is not exact but seems to work. +      QString label = yLabelIt.value();
+      if (label.contains("e-")) {
+        label.append('+');
+      }
+
+      QRectF bound = painter->boundingRect(QRectF(), flags, label);
       QPointF p(plotRect().left() - bound.width() / 2.0 - \
_calculatedAxisMarginHLead, mapYToPlot(yLabelIt.key()));  bound.moveCenter(p);
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic