소스 검색

moving OBO cases to useful spot

tarfeef101 7 년 전
부모
커밋
05c3fbb48c
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      assignments/a2/src/main/java/Model.java

+ 3 - 4
assignments/a2/src/main/java/Model.java

@@ -89,14 +89,13 @@ public class Model extends Observable
       tempLen += thingies.get(i).getVisibleLen();
       index = i;
     }
- 
-    // 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);
-    //if (curThingy.getVisibleLen() == curThingy.getPoints().size() && tempLen < x) curThingy = thingies.get(index + 1);
     
     System.out.println("index is: " + index);
     System.out.println("curthing is: " + 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);
+    if (curThingy.getVisibleLen() == curThingy.getPoints().size() && tempLen < x) curThingy = thingies.get(index + 1);
     // now modify tempThingy
     // if we want to go back in time
     if (tempLen > x)