tsdedhar 6 лет назад
Родитель
Сommit
0274688617

BIN
assignments/a2/.gradle/4.7/fileHashes/fileHashes.bin


BIN
assignments/a2/.gradle/4.7/fileHashes/fileHashes.lock


BIN
assignments/a2/.gradle/4.7/taskHistory/taskHistory.bin


BIN
assignments/a2/.gradle/4.7/taskHistory/taskHistory.lock


BIN
assignments/a2/.gradle/buildOutputCleanup/buildOutputCleanup.lock


BIN
assignments/a2/build/classes/java/main/Model.class


BIN
assignments/a2/build/libs/a2-1.0-SNAPSHOT.jar


+ 1 - 1
assignments/a2/src/main/java/Model.java

@@ -97,7 +97,7 @@ public class Model extends Observable
     }
     
     System.out.println("index is: " + index);
-    if (Math.abs(index - thingies.indexOf(curThingy)) > 1) index = thingies.indexOf(curThingy);
+    if (Math.abs(index - thingies.indexOf(curThingy)) > 1 && index != (thingies.size() - 1)) index = thingies.indexOf(curThingy);
     curThingy = thingies.get(index);
     // off by one adjustments if we're at the end of a thingy
     if (index > 0 && curThingy.getVisibleLen() == 0 && tempLen > x) curThingy = thingies.get(index - 1);