Fixed Row- and ColumnAnimation

This commit is contained in:
NichtStudioCode 2022-02-15 22:36:44 +01:00
parent 86f0722a53
commit 0136354b57
2 changed files with 4 additions and 4 deletions

@ -12,7 +12,7 @@ public class ColumnAnimation extends SoundAnimation {
protected void handleFrame(int frame) { protected void handleFrame(int frame) {
boolean showedSomething = false; boolean showedSomething = false;
while (!showedSomething || column == getWidth() - 1) { while (!showedSomething && column < getWidth()) {
for (int y = 0; y < getHeight(); y++) { for (int y = 0; y < getHeight(); y++) {
int index = convToIndex(column, y); int index = convToIndex(column, y);
if (getSlots().contains(index)) { if (getSlots().contains(index)) {
@ -24,7 +24,7 @@ public class ColumnAnimation extends SoundAnimation {
column++; column++;
} }
if (column == getHeight() - 1) finish(); if (column >= getWidth()) finish();
} }
} }

@ -12,7 +12,7 @@ public class RowAnimation extends SoundAnimation {
protected void handleFrame(int frame) { protected void handleFrame(int frame) {
boolean showedSomething = false; boolean showedSomething = false;
while (!showedSomething || row == getHeight() - 1) { while (!showedSomething && row < getHeight()) {
for (int x = 0; x < getWidth(); x++) { for (int x = 0; x < getWidth(); x++) {
int index = convToIndex(x, row); int index = convToIndex(x, row);
if (getSlots().contains(index)) { if (getSlots().contains(index)) {
@ -24,7 +24,7 @@ public class RowAnimation extends SoundAnimation {
row++; row++;
} }
if (frame == getHeight() - 1) finish(); if (row >= getHeight()) finish();
} }
} }