From 56c0e2d639f7560db4d80de06e9d63640b8bbee2 Mon Sep 17 00:00:00 2001 From: "dr.abc" Date: Mon, 9 Sep 2024 16:32:24 +0800 Subject: [PATCH] fix a error with one frame spr --- SPRView.Net.Lib/Class/Sprite.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPRView.Net.Lib/Class/Sprite.cs b/SPRView.Net.Lib/Class/Sprite.cs index 00c4792..c2b674a 100644 --- a/SPRView.Net.Lib/Class/Sprite.cs +++ b/SPRView.Net.Lib/Class/Sprite.cs @@ -121,12 +121,12 @@ public static void Save(string[] files, Stream stream, int width, int height, var path = files[i]; Image frame = Image.Load(path); frame.Mutate(x => x.Resize(width, height)); - do + while (frame.Frames.Count > 1) { image.Mutate(x => x.DrawImage(frame, new Point(0, height * bufferseek), 1.0f)); frame.Frames.RemoveFrame(0); bufferseek++; - } while (frame.Frames.Count > 1); + }; frame.Dispose(); } bool isAlphaTest = format == ISprite.SpriteFormat.AlphaTest;