diff options
author | 2021-03-24 04:59:13 +0100 | |
---|---|---|
committer | 2021-03-24 04:59:13 +0100 | |
commit | d66a34b27272ed9d6c143483b0a700468b00e311 (patch) | |
tree | 246b42be21402c16ee44b7ae5a401463519d1c2e /winit | |
parent | 0333a8daff6db989adc6035a4c09df171a86f6fe (diff) | |
download | iced-d66a34b27272ed9d6c143483b0a700468b00e311.tar.gz iced-d66a34b27272ed9d6c143483b0a700468b00e311.tar.bz2 iced-d66a34b27272ed9d6c143483b0a700468b00e311.zip |
Convert `ScaleFactorChanged` into `Resized` events in `iced_winit`
... instead of just dropping them when calling `to_static`.
Diffstat (limited to 'winit')
-rw-r--r-- | winit/src/application.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index d7d7660e..5aefb378 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -164,7 +164,22 @@ where return; } - if let Some(event) = event.to_static() { + let event = match event { + winit::event::Event::WindowEvent { + event: + winit::event::WindowEvent::ScaleFactorChanged { + new_inner_size, + .. + }, + window_id, + } => Some(winit::event::Event::WindowEvent { + event: winit::event::WindowEvent::Resized(*new_inner_size), + window_id, + }), + _ => event.to_static(), + }; + + if let Some(event) = event { sender.start_send(event).expect("Send event"); let poll = instance.as_mut().poll(&mut context); |