From 335dca924603290916c7698cf2e0c691c2410b99 Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Wed, 9 Feb 2022 23:01:59 +0100 Subject: [PATCH] Use available UI size to size image --- src/decoder.rs | 2 +- src/ui.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/decoder.rs b/src/decoder.rs index 218a442..b1653c8 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -179,7 +179,7 @@ where previous_sample = sample; - if progress % (PIXELS_PER_LINE * 4)== 0 { + if progress % (PIXELS_PER_LINE * 4) == 0 { if !progress_update((progress as f32) / (step * 10) as f32, img.to_rgba8()) { return Ok(()); } diff --git a/src/ui.rs b/src/ui.rs index 4580575..19a3c83 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -159,6 +159,8 @@ impl epi::App for DecoderApp { let mut state = decoding_state.lock().unwrap(); state.run_state = DecoderRunState::DONE; + + frame.request_repaint(); }); } if ui @@ -178,7 +180,7 @@ impl epi::App for DecoderApp { ui.separator(); if let Some((texture, size)) = state.texture { - ui.image(texture, size); + ui.image(texture, ui.available_size()); } }); }