diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index e9f74135f..003ef11c2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -117,27 +117,32 @@ public class ItemSlot extends Button { protected void layout() { super.layout(); - icon.x = x + (width - icon.width) / 2; - icon.y = y + (height - icon.height) / 2; + icon.x = x + (width - icon.width) / 2f; + icon.y = y + (height - icon.height) / 2f; + PixelScene.align(icon); if (topLeft != null) { topLeft.x = x; topLeft.y = y; + PixelScene.align(topLeft); } if (topRight != null) { topRight.x = x + (width - topRight.width()); topRight.y = y; + PixelScene.align(topRight); } if (bottomRight != null) { bottomRight.x = x + (width - bottomRight.width()); bottomRight.y = y + (height - bottomRight.height()); + PixelScene.align(bottomRight); } if (bottomRightIcon != null) { bottomRightIcon.x = x + (width - bottomRightIcon.width()) -1; bottomRightIcon.y = y + (height - bottomRightIcon.height()); + PixelScene.align(bottomRightIcon); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/IconTitle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/IconTitle.java index 6abaf2c7b..a02c80467 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/IconTitle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/IconTitle.java @@ -81,6 +81,7 @@ public class IconTitle extends Component { imIcon.x = x + (Math.max(0, 8 - imIcon.width()/2)); imIcon.y = y + (Math.max(0, 8 - imIcon.height()/2)); + PixelScene.align(imIcon); int imWidth = (int)Math.max(imIcon.width(), 16); int imHeight = (int)Math.max(imIcon.height(), 16);