Use available UI size to size image

This commit is contained in:
Sebastian 2022-02-09 23:01:59 +01:00
parent 2515e2e8f5
commit 335dca9246
2 changed files with 4 additions and 2 deletions

View File

@ -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(());
}

View File

@ -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());
}
});
}