From d6454b5d0ca4c3812d1614805de1094638153df1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 22 Feb 2024 09:19:51 +0100 Subject: Rename `fetch_location` to `fetch_position` --- winit/src/multi_window.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'winit/src/multi_window.rs') diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs index 3b00200b..c9056c9f 100644 --- a/winit/src/multi_window.rs +++ b/winit/src/multi_window.rs @@ -993,26 +993,17 @@ fn run_command( window.raw.set_minimized(minimized); } } - window::Action::Move(id, position) => { - if let Some(window) = window_manager.get_mut(id) { - window.raw.set_outer_position( - winit::dpi::LogicalPosition { - x: position.x, - y: position.y, - }, - ); - } - } - window::Action::FetchLocation(id, callback) => { + window::Action::FetchPosition(id, callback) => { if let Some(window) = window_manager.get_mut(id) { let position = window .raw .inner_position() - .map(|p| { - let pos = p.to_logical::( + .map(|position| { + let position = position.to_logical::( window.raw.scale_factor(), ); - crate::core::Point::new(pos.x, pos.y) + + crate::core::Point::new(position.x, position.y) }) .ok(); @@ -1021,6 +1012,16 @@ fn run_command( .expect("Send message to event loop"); } } + window::Action::Move(id, position) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_outer_position( + winit::dpi::LogicalPosition { + x: position.x, + y: position.y, + }, + ); + } + } window::Action::ChangeMode(id, mode) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_visible(conversion::visible(mode)); -- cgit