Skip to content

Commit

Permalink
Does not handle mismatched touchid (#16078)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua authored Aug 24, 2023
1 parent e9ca89f commit e86f6d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion native/cocos/platform/openharmony/OpenHarmonyPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ void dispatchTouchEventCB(OH_NativeXComponent* component, void* window) {
ev->type = cc::TouchEvent::Type::CANCELLED;
}
for (int i = 0; i < touchEvent.numPoints; ++i) {
ev->touches.emplace_back(touchEvent.touchPoints[i].x, touchEvent.touchPoints[i].y, touchEvent.touchPoints[i].id);
int32_t id = touchEvent.touchPoints[i].id;
if (touchEvent.id == id) {
ev->touches.emplace_back(touchEvent.touchPoints[i].x, touchEvent.touchPoints[i].y, id);
}
}
sendMsgToWorker(cc::MessageType::WM_XCOMPONENT_TOUCH_EVENT, reinterpret_cast<void*>(ev), window);
}
Expand Down

0 comments on commit e86f6d2

Please sign in to comment.