diff options
author | 2024-02-22 09:19:51 +0100 | |
---|---|---|
committer | 2024-02-22 09:19:51 +0100 | |
commit | d6454b5d0ca4c3812d1614805de1094638153df1 (patch) | |
tree | 18418ebe4c69ae1d3cb9668aed9069338cf70270 /winit/src/multi_window.rs | |
parent | 59885e9a363dd73b3a3e8dd125decf0e34130c59 (diff) | |
download | iced-d6454b5d0ca4c3812d1614805de1094638153df1.tar.gz iced-d6454b5d0ca4c3812d1614805de1094638153df1.tar.bz2 iced-d6454b5d0ca4c3812d1614805de1094638153df1.zip |
Rename `fetch_location` to `fetch_position`
Diffstat (limited to 'winit/src/multi_window.rs')
-rw-r--r-- | winit/src/multi_window.rs | 29 |
1 files changed, 15 insertions, 14 deletions
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<A, C, E>( 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::<f32>( + .map(|position| { + let position = position.to_logical::<f32>( 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<A, C, E>( .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)); |