From 32ccf721124ef44ec23392b2db6f02367d1d1899 Mon Sep 17 00:00:00 2001 From: Infi Date: Sat, 11 May 2024 09:09:36 +0200 Subject: [PATCH] Fix FrameDelay being too fast --- ChatTwo/EmoteCache.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChatTwo/EmoteCache.cs b/ChatTwo/EmoteCache.cs index 32b2fbf..ff58302 100644 --- a/ChatTwo/EmoteCache.cs +++ b/ChatTwo/EmoteCache.cs @@ -255,6 +255,11 @@ public static class EmoteCache foreach (var frame in img.Frames) { var delay = frame.Metadata.GetGifMetadata().FrameDelay / 100f; + + // Follows the same pattern as browsers, anything under 0.02s delay will be rounded up to 0.1s + if (delay < 0.02f) + delay = 0.1f; + var buffer = new byte[4 * frame.Width * frame.Height]; frame.CopyPixelDataTo(buffer); var tex = await Plugin.Interface.UiBuilder.LoadImageRawAsync(buffer, frame.Width, frame.Height, 4);