diff --git a/src/org/infinity/util/IconCache.java b/src/org/infinity/util/IconCache.java index 44f781e3c..d8bd02ea0 100644 --- a/src/org/infinity/util/IconCache.java +++ b/src/org/infinity/util/IconCache.java @@ -170,10 +170,10 @@ private static synchronized Image getScaledImage(Image image, int size, boolean Image retVal = image; if (image != null) { - if (image.getHeight(null) != size) { + if (image.getWidth(null) != size || image.getHeight(null) != size) { final int dstWidth; final int dstHeight; - if (image.getHeight(null) > size) { + if (image.getWidth(null) > size || image.getHeight(null) > size) { // preserve image aspect ratio dstWidth = (image.getWidth(null) >= image.getHeight(null)) ? size : image.getWidth(null) * size / image.getHeight(null); dstHeight = (image.getHeight(null) >= image.getWidth(null)) ? size : image.getHeight(null) * size / image.getWidth(null);