image: Fix textures and bg color not reloading

The reload procedure for changed image files is triggered
but the old data has to be deleted to be re-generated.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/176>
This commit is contained in:
Sophie Herold 2023-04-13 01:19:53 +02:00
parent aca49427a1
commit 8669b870af
2 changed files with 21 additions and 0 deletions

View file

@ -742,6 +742,10 @@ impl LpImage {
self.set_file(file);
let tiles = &self.imp().frame_buffer;
// Delete all stored textures for reloads
tiles.reset();
// Reset background color for reloads
self.set_background_color(None);
let (decoder, mut decoder_update) = match Decoder::new(file.clone(), tiles.clone()).await {
Ok(x) => x,