diff --git a/InvUI/src/main/java/de/studiocode/invui/animation/impl/ColumnAnimation.java b/InvUI/src/main/java/de/studiocode/invui/animation/impl/ColumnAnimation.java index 78c6fda..760392b 100644 --- a/InvUI/src/main/java/de/studiocode/invui/animation/impl/ColumnAnimation.java +++ b/InvUI/src/main/java/de/studiocode/invui/animation/impl/ColumnAnimation.java @@ -12,7 +12,7 @@ public class ColumnAnimation extends SoundAnimation { protected void handleFrame(int frame) { boolean showedSomething = false; - while (!showedSomething || column == getWidth() - 1) { + while (!showedSomething && column < getWidth()) { for (int y = 0; y < getHeight(); y++) { int index = convToIndex(column, y); if (getSlots().contains(index)) { @@ -24,7 +24,7 @@ public class ColumnAnimation extends SoundAnimation { column++; } - if (column == getHeight() - 1) finish(); + if (column >= getWidth()) finish(); } } diff --git a/InvUI/src/main/java/de/studiocode/invui/animation/impl/RowAnimation.java b/InvUI/src/main/java/de/studiocode/invui/animation/impl/RowAnimation.java index 4fbb948..cfe7ed2 100644 --- a/InvUI/src/main/java/de/studiocode/invui/animation/impl/RowAnimation.java +++ b/InvUI/src/main/java/de/studiocode/invui/animation/impl/RowAnimation.java @@ -12,7 +12,7 @@ public class RowAnimation extends SoundAnimation { protected void handleFrame(int frame) { boolean showedSomething = false; - while (!showedSomething || row == getHeight() - 1) { + while (!showedSomething && row < getHeight()) { for (int x = 0; x < getWidth(); x++) { int index = convToIndex(x, row); if (getSlots().contains(index)) { @@ -24,7 +24,7 @@ public class RowAnimation extends SoundAnimation { row++; } - if (frame == getHeight() - 1) finish(); + if (row >= getHeight()) finish(); } }