Merge branch 'timvinc/1912_3rd_person_view_jumping' into 'master'

Fixes #1912 - stops centering the cursor to prevent camera jumping when the cursor grab is released

Closes #1912

See merge request veloren/veloren!4271
This commit is contained in:
Imbris 2024-01-24 07:43:53 +00:00
commit b6dfa349bb
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 - You can no longer stack self buffs
- Renamed "Burning Potion" to "Potion of Combustion" - Renamed "Burning Potion" to "Potion of Combustion"
- Render LoD terrain on the character selection screen - Render LoD terrain on the character selection screen
- Camera no longer jumps on first mouse event after cursor grab is released on macos
### Removed ### Removed
- Medium and large potions from all loot tables - Medium and large potions from all loot tables

View File

@ -1162,6 +1162,10 @@ impl Show {
ui.handle_event(ui::Event( ui.handle_event(ui::Event(
conrod_core::input::Motion::MouseCursor { x: 0.0, y: 0.0 }.into(), 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(); global_state.window.center_cursor();
} }
} }

View File

@ -988,6 +988,9 @@ impl Window {
}, },
WindowEvent::CursorMoved { position, .. } => { WindowEvent::CursorMoved { position, .. } => {
if self.cursor_grabbed { 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(); self.center_cursor();
} else { } else {
self.cursor_position = position; self.cursor_position = position;