Change pointer ID allocation on iOS. Fixes part of #14240

The dialog code checks for touch.id != 0 to decide whether to close.

Not sure if really necessary, but keeping it and just changing the IDs.
This commit is contained in:
Henrik Rydgård 2021-04-17 12:07:40 +02:00
parent f5a1de2540
commit 0150dcfd44
2 changed files with 5 additions and 4 deletions

View file

@ -226,8 +226,9 @@ bool PopupScreen::touch(const TouchInput &touch) {
return UIDialogScreen::touch(touch);
}
if (!box_->GetBounds().Contains(touch.x, touch.y))
if (!box_->GetBounds().Contains(touch.x, touch.y)) {
TriggerFinish(DR_BACK);
}
return UIDialogScreen::touch(touch);
}

View file

@ -386,8 +386,8 @@ static LocationHelper *locationHelper;
}
int ToTouchID(UITouch *uiTouch, bool allowAllocate) {
// Find the id for the touch. Avoid 0 (mouse.)
for (int localId = 1; localId < (int)ARRAY_SIZE(g_touches); ++localId) {
// Find the id for the touch.
for (int localId = 0; localId < (int)ARRAY_SIZE(g_touches); ++localId) {
if (g_touches[localId] == uiTouch) {
return localId;
}
@ -395,7 +395,7 @@ int ToTouchID(UITouch *uiTouch, bool allowAllocate) {
// Allocate a new one, perhaps?
if (allowAllocate) {
for (int localId = 1; localId < (int)ARRAY_SIZE(g_touches); ++localId) {
for (int localId = 0; localId < (int)ARRAY_SIZE(g_touches); ++localId) {
if (g_touches[localId] == 0) {
g_touches[localId] = uiTouch;
return localId;