mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
Currently, when items are inside a scroll view, when the scroll view is dragged and released, the item's click event will still trigger its listener if the same item is hovered. This adds a way to disable pointer events. In this implementation, when a scroll drag begins, we set the GestureClickPhase to disabled which prevents clicks from being captured. Co-authored-by: Philip Chung <philterdesign@gmail.com>
27 lines
459 B
C++
27 lines
459 B
C++
#ifndef _RIVE_POINTER_EVENT_HPP_
|
|
#define _RIVE_POINTER_EVENT_HPP_
|
|
|
|
#include "rive/math/vec2d.hpp"
|
|
|
|
namespace rive
|
|
{
|
|
|
|
enum class PointerEventType
|
|
{
|
|
down, // The button has gone from up to down
|
|
move, // The pointer's position has changed
|
|
up, // The button has gone from down to up
|
|
};
|
|
|
|
struct PointerEvent
|
|
{
|
|
PointerEventType m_Type;
|
|
Vec2D m_Position;
|
|
int m_PointerIndex;
|
|
|
|
// add more fields as needed
|
|
};
|
|
} // namespace rive
|
|
|
|
#endif
|