|
@@ -85,13 +85,22 @@ public class Model extends Observable
|
|
|
|
|
|
public void changeThingy(int x) // int x is the position in the slider we are at
|
|
|
{
|
|
|
- int tempLen = 0;
|
|
|
+ /*int tempLen = 0;
|
|
|
int index = 0;
|
|
|
|
|
|
for (int i = 0; i < thingies.size() && tempLen <= x; i++)
|
|
|
{
|
|
|
tempLen += thingies.get(i).getVisibleLen();
|
|
|
index = i;
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+ int index = 0;
|
|
|
+ int tempLen = 0;
|
|
|
+ while (tempLen <= totalVisibleLen && index < thingies.size())
|
|
|
+ {
|
|
|
+ tempLen += thingies.get(index).getVisibleLen();
|
|
|
+ ++index;
|
|
|
}
|
|
|
|
|
|
//if (Math.abs(index - thingies.indexOf(curThingy)) > 1 && index != (thingies.size() - 1)) index = thingies.indexOf(curThingy);
|