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