Przeglądaj źródła

fixed mouse movements are bound to the screen resolution (https://github.com/raysan5/raylib/issues/1392) (#1410)

pull/1411/head
kernelkinetic 5 lat temu
committed by GitHub
rodzic
commit
3c9f7263e5
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 7 dodań i 4 usunięć
  1. +7
    -4
      src/core.c

+ 7
- 4
src/core.c Wyświetl plik

@ -5338,11 +5338,14 @@ static void *EventThread(void *arg)
}
// Screen confinement
if (CORE.Input.Mouse.position.x < 0) CORE.Input.Mouse.position.x = 0;
if (CORE.Input.Mouse.position.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.position.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x;
if (!CORE.Input.Mouse.cursorHidden)
{
if (CORE.Input.Mouse.position.x < 0) CORE.Input.Mouse.position.x = 0;
if (CORE.Input.Mouse.position.x > CORE.Window.screen.width/CORE.Input.Mouse.scale.x) CORE.Input.Mouse.position.x = CORE.Window.screen.width/CORE.Input.Mouse.scale.x;
if (CORE.Input.Mouse.position.y < 0) CORE.Input.Mouse.position.y = 0;
if (CORE.Input.Mouse.position.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.position.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y;
if (CORE.Input.Mouse.position.y < 0) CORE.Input.Mouse.position.y = 0;
if (CORE.Input.Mouse.position.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.position.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y;
}
// Gesture update
if (gestureUpdate)

Ładowanie…
Anuluj
Zapisz