mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
feat(Android): Multitouch and pointer exit support (#10848) 9bcc4a6d11
Adds multitouch and pointer exit support. Also bumps the compile and target SDK to 36, adding `core-ktx` dependency for one method. Co-authored-by: Erik <erik@rive.app>
This commit is contained in:
@@ -1 +1 @@
|
||||
33c9ac9f95498a294246e58b0c072650f00cda20
|
||||
9bcc4a6d11ef0f197026ed109a144a24eee394cf
|
||||
|
||||
@@ -518,6 +518,7 @@ public:
|
||||
Vec2D screenBounds; // the bounds of coordinate system of the cursor
|
||||
Vec2D position; // the cursor position
|
||||
float scaleFactor = 1.0f; // scale factor for things like retina display
|
||||
int pointerId = 0; // stable pointer identifier for multitouch
|
||||
};
|
||||
|
||||
// All pointer events will automatically convert between artboard and screen
|
||||
|
||||
@@ -1262,8 +1262,7 @@ bool CommandServer::processCommands()
|
||||
requestId,
|
||||
CommandQueue::Message::viewModelError)
|
||||
<< "Property type " << data.type
|
||||
<< " is not valid when "
|
||||
<< "subscribing";
|
||||
<< " is not valid when subscribing";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2558,7 +2557,9 @@ bool CommandServer::processCommands()
|
||||
{
|
||||
Vec2D position =
|
||||
cursorPosForPointerEvent(stateMachine, pointerEvent);
|
||||
stateMachine->pointerMove(position);
|
||||
stateMachine->pointerMove(position,
|
||||
0.0f,
|
||||
pointerEvent.pointerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2586,7 +2587,7 @@ bool CommandServer::processCommands()
|
||||
{
|
||||
Vec2D position =
|
||||
cursorPosForPointerEvent(stateMachine, pointerEvent);
|
||||
stateMachine->pointerDown(position, 0);
|
||||
stateMachine->pointerDown(position, pointerEvent.pointerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2614,7 +2615,7 @@ bool CommandServer::processCommands()
|
||||
{
|
||||
Vec2D position =
|
||||
cursorPosForPointerEvent(stateMachine, pointerEvent);
|
||||
stateMachine->pointerUp(position, 0);
|
||||
stateMachine->pointerUp(position, pointerEvent.pointerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2642,7 +2643,7 @@ bool CommandServer::processCommands()
|
||||
{
|
||||
Vec2D position =
|
||||
cursorPosForPointerEvent(stateMachine, pointerEvent);
|
||||
stateMachine->pointerExit(position, 0);
|
||||
stateMachine->pointerExit(position, pointerEvent.pointerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user