diff --git a/CHANGELOG.md b/CHANGELOG.md index febfc763..da2e8e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - **Breaking:** On Web, the canvas element associated to a `Window` is no longer removed from the DOM when the `Window` is dropped. - On Web, `WindowEvent::Resized` is now emitted when `Window::set_inner_size` is called. - **Breaking:** `Fullscreen` enum now uses `Borderless(Option)` instead of `Borderless(MonitorHandle)` to allow picking the current monitor. +- On MacOS, fix `WindowEvent::Moved` ignoring the scale factor. # 0.22.2 (2020-05-16) diff --git a/src/platform_impl/macos/window_delegate.rs b/src/platform_impl/macos/window_delegate.rs index d9067561..c226a66d 100644 --- a/src/platform_impl/macos/window_delegate.rs +++ b/src/platform_impl/macos/window_delegate.rs @@ -15,7 +15,7 @@ use objc::{ }; use crate::{ - dpi::LogicalSize, + dpi::{LogicalPosition, LogicalSize}, event::{Event, ModifiersState, WindowEvent}, platform_impl::platform::{ app_state::AppState, @@ -112,7 +112,9 @@ impl WindowDelegateState { let moved = self.previous_position != Some((x, y)); if moved { self.previous_position = Some((x, y)); - self.emit_event(WindowEvent::Moved((x, y).into())); + let scale_factor = self.get_scale_factor(); + let physical_pos = LogicalPosition::::from((x, y)).to_physical(scale_factor); + self.emit_event(WindowEvent::Moved(physical_pos)); } }