From 0136354b5707f4b467c5204c289a264878e7a46d Mon Sep 17 00:00:00 2001 From: NichtStudioCode <51272202+NichtStudioCode@users.noreply.github.com> Date: Tue, 15 Feb 2022 22:36:44 +0100 Subject: [PATCH] Fixed Row- and ColumnAnimation --- .../de/studiocode/invui/animation/impl/ColumnAnimation.java | 4 ++-- .../java/de/studiocode/invui/animation/impl/RowAnimation.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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(); } }