1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qxyseriesanimation_p.h"
5
6/*!
7 \qmltype XYSeriesAnimation
8 \qmlabstract
9 \inqmlmodule QtGraphs
10 \ingroup graphs_qml_2D
11 \inherits GraphAnimation
12 \brief An animation type which signifies the animation for points.
13
14 XYSeriesAnimation is based on GraphAnimation and encapsulates all animations available to XYSeries graphs.
15 This type initializes the state for its derived animations, but, as it is absract, can not be directly used
16 for animations. See the child types GraphPointAnimation and SplineControlAnimation.
17
18 \sa GraphAnimation, GraphPointAnimation, SplineControlAnimation
19*/
20
21QXYSeriesAnimation::QXYSeriesAnimation(QObject *parent)
22 : QGraphAnimation(parent)
23{}
24
25QXYSeriesAnimation::~QXYSeriesAnimation() {}
26
27void QXYSeriesAnimation::updateCurrent(QGraphTransition::TransitionType tt, int index, QPointF point)
28{
29 m_currentTransitionType = tt;
30 m_newPointIndex = index;
31 m_newPoint = point;
32
33 if (m_previousTransitionType == QGraphTransition::TransitionType::None)
34 m_previousTransitionType = m_currentTransitionType;
35
36 if (animating() == QGraphAnimation::AnimationState::Stopped)
37 m_activePointIndex = index;
38}
39

source code of qtgraphs/src/graphs2d/animation/qxyseriesanimation.cpp