Fix for crash.

This commit is contained in:
Attila Uygun 2022-06-10 22:39:23 +02:00
parent a2dafd172e
commit 0bd3a1c607
1 changed files with 4 additions and 2 deletions

View File

@ -229,9 +229,11 @@ int32_t Platform::HandleInput(android_app* app, AInputEvent* event) {
Vector2f pos[2] = {platform->pointer_pos_[0], platform->pointer_pos_[1]};
for (auto i = 0; i < count; ++i) {
int32_t id = AMotionEvent_getPointerId(event, i);
if (id < 2) {
pos[id] = {AMotionEvent_getX(event, i), AMotionEvent_getY(event, i)};
pos[id] = platform->engine_->ToPosition(pos[id]);
}
}
if (pointer_id >= 2)
return 0;