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/application.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/application.rs')
-rw-r--r-- | winit/src/application.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index c86d1619..8d0d7456 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -767,19 +767,14 @@ pub fn run_command<A, C, E>( window::Action::Minimize(_id, minimized) => { window.set_minimized(minimized); } - window::Action::Move(_id, position) => { - window.set_outer_position(winit::dpi::LogicalPosition { - x: position.x, - y: position.y, - }); - } - window::Action::FetchLocation(_id, callback) => { + window::Action::FetchPosition(_id, callback) => { let position = window .inner_position() - .map(|p| { - let pos = - p.to_logical::<f32>(window.scale_factor()); - crate::core::Point::new(pos.x, pos.y) + .map(|position| { + let position = position + .to_logical::<f32>(window.scale_factor()); + + crate::core::Point::new(position.x, position.y) }) .ok(); @@ -787,6 +782,12 @@ pub fn run_command<A, C, E>( .send_event(callback(position)) .expect("Send message to event loop"); } + window::Action::Move(_id, position) => { + window.set_outer_position(winit::dpi::LogicalPosition { + x: position.x, + y: position.y, + }); + } window::Action::ChangeMode(_id, mode) => { window.set_visible(conversion::visible(mode)); window.set_fullscreen(conversion::fullscreen( |