From 65e778986384b4556e1add95131f845f48690642 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Wed, 27 Sep 2023 00:47:24 +0200 Subject: [PATCH] decoder: Fix animations with variable frame length Before, the length of the first frame was used for all frames. Part-of: --- src/decoder/formats/glycin_proxy.rs | 2 +- src/decoder/tiling.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decoder/formats/glycin_proxy.rs b/src/decoder/formats/glycin_proxy.rs index 49103fb..7c545a9 100644 --- a/src/decoder/formats/glycin_proxy.rs +++ b/src/decoder/formats/glycin_proxy.rs @@ -106,7 +106,7 @@ impl Glycin { texture: frame.texture, }; - tiles.push_frame(tile, dimensions, delay); + tiles.push_frame(tile, dimensions, frame.delay.unwrap_or(delay)); if tiles.n_frames() >= FRAME_BUFFER { break; diff --git a/src/decoder/tiling.rs b/src/decoder/tiling.rs index 1d263c0..2bddc3f 100644 --- a/src/decoder/tiling.rs +++ b/src/decoder/tiling.rs @@ -661,7 +661,7 @@ impl FrameBufferExt for ArcSwap { if self .load() .images - .get(1) + .front() .is_some_and(|next_frame| elapsed >= next_frame.delay) { self.rcu(|tiling_store| {