summaryrefslogtreecommitdiffstats
path: root/src/animations
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@digia.com>2012-09-26 18:09:54 +0300
committerMichal Klocek <michal.klocek@digia.com>2012-09-26 18:12:15 +0300
commit80de54ed93f05f2030c14872a746c643db15356b (patch)
treee22d225982ee1525bf89406cfb88c09dde3e404b /src/animations
parenta93a773ef5120bc796637e46b69288eb4e1bd724 (diff)
Refactors axis updateGeometry handling
* adds verticalaxis class * adds horizontalaxis class * adds updateGeometry logic to base clases * fixes small issues with axis hadnling for datetime,category,barcategory axis
Diffstat (limited to 'src/animations')
-rw-r--r--src/animations/axisanimation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/animations/axisanimation.cpp b/src/animations/axisanimation.cpp
index cb9b9175..6bc49e7e 100644
--- a/src/animations/axisanimation.cpp
+++ b/src/animations/axisanimation.cpp
@@ -69,13 +69,13 @@ void AxisAnimation::setValues(QVector<qreal> &oldLayout, QVector<qreal> &newLayo
oldLayout.resize(newLayout.count());
for(int i = 0, j = oldLayout.count() - 1; i < (oldLayout.count() + 1) / 2; ++i, --j) {
- oldLayout[i] = m_axis->axisType() == ChartAxis::X_AXIS ? rect.left() : rect.bottom();
- oldLayout[j] = m_axis->axisType() == ChartAxis::X_AXIS ? rect.right() : rect.top();
+ oldLayout[i] = m_axis->orientation() == Qt::Horizontal ? rect.left() : rect.bottom();
+ oldLayout[j] = m_axis->orientation() == Qt::Horizontal ? rect.right() : rect.top();
}
}
break;
case ZoomInAnimation: {
- int index = qMin(oldLayout.count() * (m_axis->axisType() == ChartAxis::X_AXIS ? m_point.x() : (1 - m_point.y())), newLayout.count() - (qreal)1.0);
+ int index = qMin(oldLayout.count() * (m_axis->orientation() == Qt::Horizontal ? m_point.x() : (1 - m_point.y())), newLayout.count() - (qreal)1.0);
oldLayout.resize(newLayout.count());
for(int i = 0; i < oldLayout.count(); i++)
@@ -100,7 +100,7 @@ void AxisAnimation::setValues(QVector<qreal> &oldLayout, QVector<qreal> &newLayo
oldLayout.resize(newLayout.count());
QRectF rect = m_axis->gridGeometry();
for(int i = 0, j = oldLayout.count() - 1; i < oldLayout.count(); ++i, --j)
- oldLayout[i] = m_axis->axisType() == ChartAxis::X_AXIS ? rect.left() : rect.top();
+ oldLayout[i] = m_axis->orientation() == Qt::Horizontal ? rect.left() : rect.top();
}
break;
}