mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Prefer locking the cursor when grabbing it (if that option is supported)
over just confining it to the window. This prevents the cursor from moving around when controlling the camera.
This commit is contained in:
parent
a07ec63a53
commit
34ee35c524
@ -1034,8 +1034,8 @@ impl Window {
|
||||
self.window.set_cursor_visible(!grab);
|
||||
let res = if grab {
|
||||
self.window
|
||||
.set_cursor_grab(CursorGrabMode::Confined)
|
||||
.or_else(|_e| self.window.set_cursor_grab(CursorGrabMode::Locked))
|
||||
.set_cursor_grab(CursorGrabMode::Locked)
|
||||
.or_else(|_e| self.window.set_cursor_grab(CursorGrabMode::Confined))
|
||||
} else {
|
||||
self.window.set_cursor_grab(CursorGrabMode::None)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user