##// END OF EJS Templates
Fix QLogValueAxis update...
Titta Heikkala -
r2758:39be6d68b7b8
parent child
Show More
@@ -48,10 +48,10 QVector<qreal> ChartLogValueAxisX::calculateLayout() const
48 qreal ceilEdge = ceil(leftEdge);
48 qreal ceilEdge = ceil(leftEdge);
49 int tickCount = qAbs(ceil(logMax) - ceil(logMin));
49 int tickCount = qAbs(ceil(logMax) - ceil(logMin));
50
50
51 points.resize(tickCount);
51 points.resize(tickCount + 1);
52 const QRectF &gridRect = gridGeometry();
52 const QRectF &gridRect = gridGeometry();
53 const qreal deltaX = gridRect.width() / qAbs(logMax - logMin);
53 const qreal deltaX = gridRect.width() / qAbs(logMax - logMin);
54 for (int i = 0; i < tickCount; ++i)
54 for (int i = 0; i <= tickCount; ++i)
55 points[i] = (ceilEdge + qreal(i)) * deltaX - leftEdge * deltaX + gridRect.left();
55 points[i] = (ceilEdge + qreal(i)) * deltaX - leftEdge * deltaX + gridRect.left();
56
56
57 return points;
57 return points;
@@ -47,10 +47,10 QVector<qreal> ChartLogValueAxisY::calculateLayout() const
47 qreal ceilEdge = ceil(leftEdge);
47 qreal ceilEdge = ceil(leftEdge);
48 int tickCount = qAbs(ceil(logMax) - ceil(logMin));
48 int tickCount = qAbs(ceil(logMax) - ceil(logMin));
49
49
50 points.resize(tickCount);
50 points.resize(tickCount + 1);
51 const QRectF &gridRect = gridGeometry();
51 const QRectF &gridRect = gridGeometry();
52 const qreal deltaY = gridRect.height() / qAbs(logMax - logMin);
52 const qreal deltaY = gridRect.height() / qAbs(logMax - logMin);
53 for (int i = 0; i < tickCount; ++i)
53 for (int i = 0; i <= tickCount; ++i)
54 points[i] = (ceilEdge + qreal(i)) * -deltaY - leftEdge * -deltaY + gridRect.bottom();
54 points[i] = (ceilEdge + qreal(i)) * -deltaY - leftEdge * -deltaY + gridRect.bottom();
55
55
56 return points;
56 return points;
General Comments 0
You need to be logged in to leave comments. Login now