Przeglądaj źródła

Merge pull request #4873 from zet23t/bugfix-4872-sdl-touch-handling-error

[rcore][SDL2] First touch position is overwritten with mouse pos
pull/4837/merge
Ray 4 dni temu
committed by GitHub
rodzic
commit
f4f860b343
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 1 usunięć
  1. +4
    -1
      src/platforms/rcore_desktop_sdl.c

+ 4
- 1
src/platforms/rcore_desktop_sdl.c Wyświetl plik

@ -1363,7 +1363,10 @@ void PollInputEvents(void)
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];
// Map touch position to mouse position for convenience
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
if (CORE.Input.Touch.pointCount == 0)
{
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
}
int touchAction = -1; // 0-TOUCH_ACTION_UP, 1-TOUCH_ACTION_DOWN, 2-TOUCH_ACTION_MOVE
bool realTouch = false; // Flag to differentiate real touch gestures from mouse ones

Ładowanie…
Anuluj
Zapisz