From 44679fb3a613ab97c49c6b8b5472958b9fa9e8b0 Mon Sep 17 00:00:00 2001 From: fgnm Date: Tue, 2 May 2023 12:19:07 +0200 Subject: [PATCH] [editor only] Fix atlas limit error message --- .../games/rednblack/editor/utils/asset/impl/ImageAsset.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java index 74eb0329..5c1df741 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java @@ -49,10 +49,10 @@ public class ImageAsset extends Asset { int width = image.getWidth(); int height = image.getHeight(); TexturePacker.Settings settings = projectManager.getTexturePackerSettings(); - if (width >= settings.maxWidth - settings.paddingX || height >= settings.maxHeight - settings.paddingY) { + if (width > settings.maxWidth - settings.paddingX || height > settings.maxHeight - settings.paddingY) { Dialogs.showErrorDialog(Sandbox.getInstance().getUIStage(), - "Provided image exceeds atlas limits (" + settings.maxWidth + "x" + settings.maxHeight - + ")\nPlease, resize images to the correct scale.").padBottom(20).pack(); + "Provided image exceeds atlas limits (" + (settings.maxWidth - settings.paddingX) + "x" + (settings.maxHeight - settings.paddingY) + + ")\nPlease, resize images to the correct size.").padBottom(20).pack(); return false; } return true;