image component: fix images being off-centered

This commit is contained in:
Seth
2018-02-20 18:42:43 -06:00
parent 3bd7eabf57
commit 038040cf3a

View File

@@ -118,7 +118,7 @@ public class ImagePanelComponent implements RenderableEntity
int imageOffsetX = ((width - imageWidth) / 2) - (SEPARATOR / 2);
for (final BufferedImage image : images)
{
graphics.drawImage(image, imageOffsetX + ((width / images.size()) - image.getWidth()) / 2, y, null);
graphics.drawImage(image, imageOffsetX + ((imageWidth / images.size()) - image.getWidth()) / 2, y, null);
imageOffsetX += image.getWidth() + SEPARATOR;
}