Merge pull request #643 from sethtroll/fiximagecomponent

image component: fix images being off-centered
This commit is contained in:
Tomas Slusny
2018-02-24 02:50:49 +01:00
committed by GitHub

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;
}