From 2213e84e0b48b1dd276a8750969e7c8a44193263 Mon Sep 17 00:00:00 2001 From: "Dr.Abc" Date: Mon, 9 Sep 2024 19:10:19 +0800 Subject: [PATCH] fix a error --- SPRView.Net.Lib/Class/Sprite.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SPRView.Net.Lib/Class/Sprite.cs b/SPRView.Net.Lib/Class/Sprite.cs index c2b674a..e7cfc8b 100644 --- a/SPRView.Net.Lib/Class/Sprite.cs +++ b/SPRView.Net.Lib/Class/Sprite.cs @@ -121,12 +121,13 @@ 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)); - while (frame.Frames.Count > 1) + do { image.Mutate(x => x.DrawImage(frame, new Point(0, height * bufferseek), 1.0f)); - frame.Frames.RemoveFrame(0); + if (frame.Frames.Count > 1) + frame.Frames.RemoveFrame(0); bufferseek++; - }; + } while (frame.Frames.Count > 1); frame.Dispose(); } bool isAlphaTest = format == ISprite.SpriteFormat.AlphaTest;