mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-21 09:55:23 -04:00
@@ -164,8 +164,9 @@ bool FlutterAceView::HandleTouchEvent(const TouchEvent& touchEvent)
|
||||
|
||||
LOGD("HandleTouchEvent touchEvent.x: %lf, touchEvent.y: %lf, touchEvent.size: %lf",
|
||||
touchEvent.x, touchEvent.y, touchEvent.size);
|
||||
auto event = touchEvent.UpdatePointers();
|
||||
if (touchEventCallback_) {
|
||||
touchEventCallback_(touchEvent);
|
||||
touchEventCallback_(event);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -137,6 +137,32 @@ struct TouchEvent final {
|
||||
return { pointId, (x - offsetX) / scale, (y - offsetY) / scale, (screenX - offsetX) / scale,
|
||||
(screenY - offsetY) / scale, type, time, size, force, deviceId, sourceType, temp };
|
||||
}
|
||||
|
||||
TouchEvent UpdatePointers() const
|
||||
{
|
||||
TouchPoint point { .id = id,
|
||||
.x = x,
|
||||
.y = y,
|
||||
.screenX = screenX,
|
||||
.screenY = screenY,
|
||||
.downTime = time,
|
||||
.size = size,
|
||||
.force = force,
|
||||
.isPressed = (type == TouchType::DOWN) };
|
||||
TouchEvent event { .id = id,
|
||||
.x = x,
|
||||
.y = y,
|
||||
.screenX = screenX,
|
||||
.screenY = screenY,
|
||||
.type = type,
|
||||
.time = time,
|
||||
.size = size,
|
||||
.force = force,
|
||||
.deviceId = deviceId,
|
||||
.sourceType = sourceType };
|
||||
event.pointers.emplace_back(std::move(point));
|
||||
return event;
|
||||
}
|
||||
};
|
||||
|
||||
class TouchCallBackInfo : public BaseEventInfo {
|
||||
|
||||
Reference in New Issue
Block a user