diff --git a/src/animations/percentbaranimation.cpp b/src/animations/percentbaranimation.cpp index a4cc481..ad0356e 100644 --- a/src/animations/percentbaranimation.cpp +++ b/src/animations/percentbaranimation.cpp @@ -45,14 +45,13 @@ QVariant PercentBarAnimation::interpolated(const QVariant &from, const QVariant Q_ASSERT(startVector.count() == endVector.count()); - qreal zeroPos = ((m_item->geometry().height() + m_item->geometry().y()) * (1 - progress)); + qreal yAxis = m_item->geometry().height() + m_item->geometry().y(); for(int i = 0; i < startVector.count(); i++) { qreal w = endVector[i].width(); qreal h = startVector[i].height() + ((endVector[i].height() - startVector[i].height()) * progress); qreal x = endVector[i].topLeft().x(); - qreal y = startVector[i].topLeft().y() + ((endVector[i].topLeft().y() - startVector[i].topLeft().y()) * progress) - + zeroPos; + qreal y = yAxis + ((endVector[i].topLeft().y() - yAxis) * progress); QRectF value(x,y,w,h); result << value; diff --git a/src/animations/stackedbaranimation.cpp b/src/animations/stackedbaranimation.cpp index a08fb9c..640b7c9 100644 --- a/src/animations/stackedbaranimation.cpp +++ b/src/animations/stackedbaranimation.cpp @@ -45,14 +45,13 @@ QVariant StackedBarAnimation::interpolated(const QVariant &from, const QVariant Q_ASSERT(startVector.count() == endVector.count()); - qreal zeroPos = ((m_item->geometry().height() + m_item->geometry().y()) * (1 - progress)); + qreal yAxis = m_item->geometry().height() + m_item->geometry().y(); for(int i = 0; i < startVector.count(); i++) { qreal w = endVector[i].width(); qreal h = startVector[i].height() + ((endVector[i].height() - startVector[i].height()) * progress); qreal x = endVector[i].topLeft().x(); - qreal y = startVector[i].topLeft().y() + ((endVector[i].topLeft().y() - startVector[i].topLeft().y()) * progress) - + zeroPos; + qreal y = yAxis + ((endVector[i].topLeft().y() - yAxis) * progress); QRectF value(x,y,w,h); result << value;