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

Mike Fenton mike at staikos.net
Thu Jan 31 18:47:41 CET 2008


SVN commit 769155 by fenton:

Increase resolution of number drawing so that the same number should not appear for multiple lines.


 M  +3 -3      plotaxisitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/plotaxisitem.cpp #769154:769155
@@ -22,7 +22,7 @@
 #include <QGraphicsSceneHoverEvent>
 #include <QGraphicsSceneContextMenuEvent>
 
-// #define MAJOR_TICK_DEBUG
+//#define MAJOR_TICK_DEBUG
 
 namespace Kst {
 
@@ -239,7 +239,7 @@
   QRectF yLabelRect;
   foreach (qreal y, yMajorTicks) {
     int flags = Qt::TextSingleLine | Qt::AlignVCenter;
-    QString label = QString::number(y);
+    QString label = QString::number(y, 'g', 15);
 
     QRectF bound = painter->boundingRect(QRectF(), flags, label);
     QPointF p = mapToPlotFromProjection(QPointF(projectionRect().left(), y));
@@ -262,7 +262,7 @@
   QRectF xLabelRect;
   foreach (qreal x, xMajorTicks) {
     int flags = Qt::TextSingleLine | Qt::AlignVCenter;
-    QString label = QString::number(x);
+    QString label = QString::number(x, 'g', 15);
 
     QRectF bound = painter->boundingRect(QRectF(), flags, label);
     QPointF p = mapToPlotFromProjection(QPointF(x, projectionRect().top()));


More information about the Kst mailing list