xp globes: scale icon while respecting aspect ratio

This commit is contained in:
Hydrox6
2021-03-24 17:58:35 +00:00
committed by Adam
parent 1603ff76bd
commit cd835c6b8e

View File

@@ -268,15 +268,13 @@ public class XpGlobesOverlay extends Overlay
}
final int size = orbSize - config.progressArcStrokeWidth();
final int width = (int) (size * GLOBE_ICON_RATIO);
final int height = (int) (size * GLOBE_ICON_RATIO);
if (width <= 0 || height <= 0)
final int scaledIconSize = (int) (size * GLOBE_ICON_RATIO);
if (scaledIconSize <= 0)
{
return null;
}
icon = ImageUtil.resizeImage(icon, width, height);
icon = ImageUtil.resizeImage(icon, scaledIconSize, scaledIconSize, true);
xpGlobe.setSkillIcon(icon);
xpGlobe.setSize(orbSize);