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:
@ -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)
|
||||
};
|
||||
|
Reference in New Issue
Block a user