stops centering the cursor to prevent camera jumping when the cursor grab is released

This commit is contained in:
Tim Vincent 2024-01-22 14:04:23 -08:00
parent ef84ab6603
commit 2ac2f2d45e
3 changed files with 8 additions and 0 deletions

View File

@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- You can no longer stack self buffs
- Renamed "Burning Potion" to "Potion of Combustion"
- Render LoD terrain on the character selection screen
- Camera no longer jumps on first mouse event after cursor grab is released on macos
### Removed
- Medium and large potions from all loot tables

View File

@ -1162,6 +1162,10 @@ impl Show {
ui.handle_event(ui::Event(
conrod_core::input::Motion::MouseCursor { x: 0.0, y: 0.0 }.into(),
));
//TODO: An underlying OS call in winit is causing the camera to jump upon the
// next mouse movement event in macos https://github.com/rust-windowing/winit/issues/999
#[cfg(not(target_os = "macos"))]
global_state.window.center_cursor();
}
}

View File

@ -988,6 +988,9 @@ impl Window {
},
WindowEvent::CursorMoved { position, .. } => {
if self.cursor_grabbed {
//TODO: An underlying OS call in winit is causing the camera to jump upon the
// next mouse movement event in macos https://github.com/rust-windowing/winit/issues/999
#[cfg(not(target_os = "macos"))]
self.center_cursor();
} else {
self.cursor_position = position;