[NDK] fix gesture c-api

Signed-off-by:lisitaolisitao3@huawei.com

Signed-off-by: lisitao <lisitao3@huawei.com>
Change-Id: I06cab2f035618c3d32c9d7817615692e284f9838
This commit is contained in:
lisitao 2024-07-26 08:02:20 +00:00
parent 23032a7a79
commit 2151af74d1
3 changed files with 3 additions and 2 deletions

View File

@ -992,7 +992,7 @@ struct ArkUIAPIEventGestureAsyncEvent {
ArkUI_Float32 scale;
ArkUI_Float32 pinchCenterX;
ArkUI_Float32 pinchCenterY;
ArkUI_Int32 speed;
ArkUI_Float32 speed;
ArkUI_Int32 timestamp;
ArkUI_Int32 source;
ArkUI_Int32 pressure;

View File

@ -240,6 +240,7 @@ void GetGestureEvent(ArkUIAPIEventGestureAsyncEvent& ret, GestureEvent& info)
ret.scale = info.GetScale();
ret.pinchCenterX = info.GetPinchCenter().GetX();
ret.pinchCenterY = info.GetPinchCenter().GetY();
ret.speed = info.GetSpeed();
ret.source = static_cast<int32_t>(info.GetSourceDevice());
}

View File

@ -121,7 +121,7 @@ float OH_ArkUI_SwipeGesture_GetAngle(const ArkUI_GestureEvent* event)
float OH_ArkUI_SwipeGesture_GetVelocity(const ArkUI_GestureEvent* event)
{
return event->eventData.velocity;
return event->eventData.speed;
}
float OH_ArkUI_RotationGesture_GetAngle(const ArkUI_GestureEvent* event)