Restore fix for dragging on windows platforms

This commit is contained in:
Imbris 2020-11-25 00:29:28 -05:00
parent c0a8422a43
commit a545d099a2
2 changed files with 7 additions and 0 deletions

View File

@ -2628,6 +2628,9 @@ impl Hud {
WinEvent::Moved(_) => {
// Prevent the cursor from being grabbed while the window is being moved as this
// causes the window to move erratically
// TODO: this creates an issue where if you move the window then you need to
// close a menu to re-grab the mouse (and if one isn't already
// open you need to open and close a menu)
self.show.want_grab = false;
true
},

View File

@ -941,6 +941,10 @@ impl Window {
self.scale_factor = scale_factor;
self.events.push(Event::ScaleFactorChanged(scale_factor));
},
WindowEvent::Moved(winit::dpi::PhysicalPosition { x, y }) => {
self.events
.push(Event::Moved(Vec2::new(x as u32, y as u32)));
},
WindowEvent::ReceivedCharacter(c) => self.events.push(Event::Char(c)),
WindowEvent::MouseInput { button, state, .. } => {
if let (true, Some(game_inputs)) =