|
@@ -91,23 +91,23 @@ public class Model extends Observable
|
|
index = i;
|
|
index = i;
|
|
}
|
|
}
|
|
|
|
|
|
- Thingy tempThingy = thingies.get(index);
|
|
|
|
// off by one adjustments if we're at the end of a thingy
|
|
// off by one adjustments if we're at the end of a thingy
|
|
- if (tempThingy.getVisibleLen() == 0 && tempLen > x) tempThingy = thingies.get(index - 1);
|
|
|
|
- if (tempThingy.getVisibleLen() == tempThingy.getPoints().size() && tempLen < x) tempThingy = thingies.get(index + 1);
|
|
|
|
|
|
+ if (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
|
|
// now modify tempThingy
|
|
// if we want to go back in time
|
|
// if we want to go back in time
|
|
if (tempLen > x)
|
|
if (tempLen > x)
|
|
{
|
|
{
|
|
- tempThingy.reduceLen();
|
|
|
|
|
|
+ curThingy.reduceLen();
|
|
totalVisibleLen--;
|
|
totalVisibleLen--;
|
|
}
|
|
}
|
|
else // go forwards
|
|
else // go forwards
|
|
{
|
|
{
|
|
- tempThingy.increaseLen();
|
|
|
|
|
|
+ curThingy.increaseLen();
|
|
totalVisibleLen++;
|
|
totalVisibleLen++;
|
|
}
|
|
}
|
|
|
|
+
|
|
setChanged();
|
|
setChanged();
|
|
notifyObservers();
|
|
notifyObservers();
|
|
}
|
|
}
|