##// END OF EJS Templates
prevents flipping in xyseries animation
Michal Klocek -
r1220:8dbddb2db883
parent child
Show More
@@ -199,8 +199,7 void ChartAnimator::setState(State state, const QPointF &point)
199 199 void ChartAnimator::startAnimation(XYAnimation* animation)
200 200 {
201 201 Q_ASSERT(animation);
202 if (animation->state() != QAbstractAnimation::Stopped)
203 animation->stop();
202 if (animation->state() != QAbstractAnimation::Stopped) animation->stop();
204 203 animation->setDuration(ChartAnimationDuration);
205 204 animation->setEasingCurve(QEasingCurve::OutQuart);
206 205 QTimer::singleShot(0, animation, SLOT(start()));
@@ -39,11 +39,14 XYAnimation::~XYAnimation()
39 39
40 40 void XYAnimation::setAnimationType(Animation type)
41 41 {
42 if (state() != QAbstractAnimation::Stopped) stop();
42 43 m_type=type;
43 44 }
44 45
45 46 void XYAnimation::setValues(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index)
46 47 {
48 if (state() != QAbstractAnimation::Stopped) stop();
49
47 50 int x = oldPoints.count();
48 51 int y = newPoints.count();
49 52
@@ -274,7 +274,7 void XYChart::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY
274 274 QVector<QPointF> points = calculateGeometryPoints();
275 275
276 276 if(m_animation) {
277 m_animation->setAnimationType(XYAnimation::LineDrawAnimation);
277 m_animation->setAnimationType(XYAnimation::MoveDownAnimation);
278 278 }
279 279 updateChart(m_points,points);
280 280 }
General Comments 0
You need to be logged in to leave comments. Login now