mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
plasma: do not use different precision when drawing in Plasma::SignalPlotter
leads to inconsistencies Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
45674c0c4e
commit
a0b4e27567
1 changed files with 1 additions and 10 deletions
|
@ -65,7 +65,6 @@ public:
|
|||
horizontalLinesColor = verticalLinesColor;
|
||||
}
|
||||
|
||||
int precision;
|
||||
uint samples;
|
||||
uint bezierCurveOffset;
|
||||
|
||||
|
@ -115,7 +114,6 @@ SignalPlotter::SignalPlotter(QGraphicsItem *parent)
|
|||
: QGraphicsWidget(parent),
|
||||
d(new SignalPlotterPrivate)
|
||||
{
|
||||
d->precision = 0;
|
||||
d->bezierCurveOffset = 0;
|
||||
d->samples = 0;
|
||||
d->verticalMin = d->verticalMax = 0.0;
|
||||
|
@ -740,13 +738,6 @@ void SignalPlotter::calculateNiceRange()
|
|||
int logdim = (int)floor(log10(step));
|
||||
double dim = pow((double)10.0, logdim) / 2;
|
||||
int a = (int)ceil(step / dim);
|
||||
if (logdim >= 0) {
|
||||
d->precision = 0;
|
||||
} else if (a % 2 == 0) {
|
||||
d->precision = -logdim;
|
||||
} else {
|
||||
d->precision = 1 - logdim;
|
||||
}
|
||||
d->niceVertRange = d->scaledBy * dim * a * (d->horizontalLinesCount + 1);
|
||||
d->niceVertMax = d->niceVertMin + d->niceVertRange;
|
||||
}
|
||||
|
@ -1066,7 +1057,7 @@ void SignalPlotter::drawAxisText(QPainter *p, int top, int h)
|
|||
value = d->niceVertMax / d->scaledBy - y * stepsize;
|
||||
}
|
||||
|
||||
QString number = KGlobal::locale()->formatNumber(value, d->precision);
|
||||
QString number = KGlobal::locale()->formatNumber(value);
|
||||
val = QString("%1 %2").arg(number, d->unit);
|
||||
p->drawText(6, y_coord - 3, val);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue