2 * Copyright (C) 2011-2024 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "utils/Geometry.h"
12 #include "utils/Vector.h"
19 class CInertialScrollingHandler
21 friend class CApplication
;
24 CInertialScrollingHandler();
26 bool IsScrolling() { return m_bScrolling
; }
29 bool CheckForInertialScrolling(const CAction
* action
);
30 bool ProcessInertialScroll(float frameTime
);
33 * vars for inertial scrolling animation with gestures
36 // flag indicating that we currently do the inertial scrolling emulation
37 bool m_bScrolling
= false;
39 // flag indicating an abort of scrolling
40 bool m_bAborting
= false;
42 CVector m_iFlickVelocity
;
48 PanPoint(unsigned int time
, CVector velocity
) : time(time
), velocity(velocity
) {}
49 unsigned int TimeElapsed() const;
51 std::deque
<PanPoint
> m_panPoints
;
52 CPoint m_iLastGesturePoint
;
53 CVector m_inertialDeacceleration
;
54 unsigned int m_inertialStartTime
= 0;
55 float m_timeToZero
= 0.0f
;