Use available UI size to size image
This commit is contained in:
parent
2515e2e8f5
commit
335dca9246
|
@ -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(());
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue