From c7788799f12faa942a7fd6233599deffccf5836b 2012-10-09 13:03:39 From: Michal Klocek Date: 2012-10-09 13:03:39 Subject: [PATCH] Bugfix precision error when calculating layout in valueaxis --- diff --git a/src/axis/valueaxis/chartvalueaxisx.cpp b/src/axis/valueaxis/chartvalueaxisx.cpp index 2b940a7..8cffb15 100644 --- a/src/axis/valueaxis/chartvalueaxisx.cpp +++ b/src/axis/valueaxis/chartvalueaxisx.cpp @@ -50,8 +50,7 @@ QVector ChartValueAxisX::calculateLayout() const const QRectF &gridRect = gridGeometry(); const qreal deltaX = gridRect.width() / (m_tickCount - 1); for (int i = 0; i < m_tickCount; ++i) { - int x = i * deltaX + gridRect.left(); - points[i] = x; + points[i] = i * deltaX + gridRect.left(); } return points; } diff --git a/src/axis/valueaxis/chartvalueaxisy.cpp b/src/axis/valueaxis/chartvalueaxisy.cpp index 07405d1..a46dc4a 100644 --- a/src/axis/valueaxis/chartvalueaxisy.cpp +++ b/src/axis/valueaxis/chartvalueaxisy.cpp @@ -52,8 +52,7 @@ QVector ChartValueAxisY::calculateLayout() const const qreal deltaY = gridRect.height() / (m_tickCount - 1); for (int i = 0; i < m_tickCount; ++i) { - int y = i * -deltaY + gridRect.bottom(); - points[i] = y; + points[i] = i * -deltaY + gridRect.bottom(); } return points;