233 |
int pos; |
int pos; |
234 |
int currentX = x0; |
int currentX = x0; |
235 |
|
|
236 |
for (pos = p0; pos < s.getEndIndex(); pos++) |
for (pos = p0; pos < s.count; pos++) |
237 |
{ |
{ |
238 |
char nextChar = s.array[pos]; |
char nextChar = s.array[s.offset+pos]; |
239 |
if (nextChar == 0) |
if (nextChar == 0) |
240 |
{ |
{ |
241 |
if (! round) |
if (! round) |
242 |
pos--; |
pos--; |
243 |
break; |
break; |
244 |
} |
} |
245 |
if (nextChar != '\n') |
if (nextChar != '\t') |
246 |
currentX += fm.charWidth(nextChar); |
currentX += fm.charWidth(nextChar); |
247 |
else |
else |
248 |
{ |
{ |
251 |
else |
else |
252 |
currentX = (int) te.nextTabStop(currentX, pos); |
currentX = (int) te.nextTabStop(currentX, pos); |
253 |
} |
} |
254 |
if (currentX >= x) |
if (currentX > x) |
255 |
{ |
{ |
256 |
if (! round) |
if (! round) |
257 |
pos--; |
pos--; |