### Eclipse Workspace Patch 1.0
#P org.sophie2.base.model.text
|
|
|
287 | 287 | boolean isLast = true; |
288 | 288 | HotLineLayout lastLineLayout = this.lines.get(0); |
289 | 289 | int offset = 0; |
290 | | |
291 | | for (int i = 0; i < this.lines.size(); ++i) { |
| 290 | int i = 0; |
| 291 | for (; i < this.lines.size(); ++i) { |
292 | 292 | HotLineLayout lineLayout = this.lines.get(i); |
293 | 293 | if (lineLayout.getBaseY() > point.getY()) { |
294 | 294 | isLast = false; |
… |
… |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | assert lastLineLayout != null; |
304 | | offset -= lastLineLayout.getConsumedLength(); |
| 304 | |
| 305 | if (i > 0) { |
| 306 | offset -= lastLineLayout.getConsumedLength(); |
| 307 | } |
305 | 308 | |
306 | 309 | int result = lastLineLayout.getHitIndex(point.getX(), isLast) + offset; |
307 | 310 | SophieLog.debug("SimpleAreaLayout.getHitIndex(): " + result); |
308 | | |
309 | 311 | return result; |
310 | 312 | } |
311 | 313 | |