diff options
author | 2020-06-23 06:12:06 +0200 | |
---|---|---|
committer | 2020-06-23 06:12:06 +0200 | |
commit | bbdf558bd7eb3abbf69c922b34075360cd5f12c5 (patch) | |
tree | f336da274a5836bef214c21e70a51f424634cd01 /winit | |
parent | eec65a055fd4dbec5684611edc77338db0e6330e (diff) | |
download | iced-bbdf558bd7eb3abbf69c922b34075360cd5f12c5.tar.gz iced-bbdf558bd7eb3abbf69c922b34075360cd5f12c5.tar.bz2 iced-bbdf558bd7eb3abbf69c922b34075360cd5f12c5.zip |
Relayout when `Application::scale_factor` changes
Diffstat (limited to 'winit')
-rw-r--r-- | winit/src/application.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index b512aace..cb1bbf1e 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -236,6 +236,19 @@ pub fn run<A, E, C>( window.scale_factor() * new_scale_factor, ); + // We relayout the UI with the new logical size. + // The queue is empty, therefore this will never produce + // a `Command`. + // + // TODO: Properly queue `WindowResized` and `CursorMoved` + // events. + let _ = state.update( + clipboard.as_ref().map(|c| c as _), + viewport.logical_size(), + &mut renderer, + &mut debug, + ); + scale_factor = new_scale_factor; } } |