diff options
author | 2024-08-30 13:02:49 +0200 | |
---|---|---|
committer | 2024-08-30 13:02:49 +0200 | |
commit | 0dcec519be23da6d3bc409dbf7ac65407d59dc12 (patch) | |
tree | 1ba155b8948c0088db797b88ede135ff35517b61 /winit/src/program.rs | |
parent | 043f0302142e46bf1d7ba2015f83261813280fec (diff) | |
download | iced-0dcec519be23da6d3bc409dbf7ac65407d59dc12.tar.gz iced-0dcec519be23da6d3bc409dbf7ac65407d59dc12.tar.bz2 iced-0dcec519be23da6d3bc409dbf7ac65407d59dc12.zip |
Add `get_scale_factor` task to `window` module
Diffstat (limited to 'winit/src/program.rs')
-rw-r--r-- | winit/src/program.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/winit/src/program.rs b/winit/src/program.rs index c5c3133d..54221c68 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1291,7 +1291,7 @@ fn run_action<P, C>( } } window::Action::GetPosition(id, channel) => { - if let Some(window) = window_manager.get_mut(id) { + if let Some(window) = window_manager.get(id) { let position = window .raw .inner_position() @@ -1306,6 +1306,13 @@ fn run_action<P, C>( let _ = channel.send(position); } } + window::Action::GetScaleFactor(id, channel) => { + if let Some(window) = window_manager.get_mut(id) { + let scale_factor = window.raw.scale_factor(); + + let _ = channel.send(scale_factor as f32); + } + } window::Action::Move(id, position) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_outer_position( |