continue;
double curr = gapObj.d;
int d = 1;
- while (curr < -MIN_INLINE_LENGTH) {
+ while (d < gaps.size() && curr < -MIN_INLINE_LENGTH) {
GapObj next = i+d >= 0 ? gaps.get(i+d) : null;
GapObj prev = i-d >= 0 ? gaps.get(i-d) : null;
if (next != null && next.gap == Gap.SPACE) {
pcp.first.setWorldPosition(p);
}
}
- if (curr < -MIN_INLINE_LENGTH && prev != null && prev.gap == Gap.SPACE) {
+ else if (prev != null && prev.gap == Gap.SPACE) {
double move = Math.min(-curr, prev.d);
curr+= move;
prev.d -= move;
pcp.first.setWorldPosition(p);
}
}
+ else {
+ d++;
+ }
}
}
} else {