diff options
| author | kernelkinetic <[email protected]> | 2020-10-13 22:26:40 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-10-13 22:26:40 +0200 |
| commit | 3c9f7263e572a9d21076de821ae8f66d583e352e (patch) | |
| tree | 88edad783fca9060979cc8fe7269c9d6e41435a7 /src | |
| parent | fa357b8d5d934f54dd1b3cd343b05f06b732d28f (diff) | |
| download | raylib-3c9f7263e572a9d21076de821ae8f66d583e352e.tar.gz raylib-3c9f7263e572a9d21076de821ae8f66d583e352e.zip | |
fixed mouse movements are bound to the screen resolution (https://github.com/raysan5/raylib/issues/1392) (#1410)
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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) |
