From 659aba9f5dc2134546bc136b3f8e2f92e39e70b6 Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:07:03 +0800 Subject: [PATCH] Fixed float to int --- AssetStudioUtility/SpriteHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AssetStudioUtility/SpriteHelper.cs b/AssetStudioUtility/SpriteHelper.cs index bc7638a..0502c8b 100644 --- a/AssetStudioUtility/SpriteHelper.cs +++ b/AssetStudioUtility/SpriteHelper.cs @@ -194,8 +194,8 @@ namespace AssetStudio if (cropped == null) return null; - var canvas = new Image(m_Sprite.m_Rect.width, m_Sprite.m_Rect.height, SixLabors.ImageSharp.Color.Transparent); - canvas.Mutate(ctx => ctx.DrawImage(cropped, new Point(textureRectOffset.X, m_Sprite.m_Rect.height - textureRectOffset.Y - cropped.Height), 1f)); + var canvas = new Image((int)MathF.Floor(m_Sprite.m_Rect.width), (int)MathF.Floor(m_Sprite.m_Rect.height)); + canvas.Mutate(ctx => ctx.DrawImage(cropped, new Point((int)MathF.Floor(textureRectOffset.X), (int)MathF.Floor(m_Sprite.m_Rect.height - textureRectOffset.Y - cropped.Height)), 1f)); cropped.Dispose(); return canvas;