equal
deleted
inserted
replaced
170 Rectangle2D alloc = (a instanceof Rectangle2D) ? (Rectangle2D)a : a.getBounds2D(); |
170 Rectangle2D alloc = (a instanceof Rectangle2D) ? (Rectangle2D)a : a.getBounds2D(); |
171 //Move the y co-ord of the hit onto the baseline. This is because TextLayout supports |
171 //Move the y co-ord of the hit onto the baseline. This is because TextLayout supports |
172 //italic carets and we do not. |
172 //italic carets and we do not. |
173 TextHitInfo hit = layout.hitTestChar(x - (float)alloc.getX(), 0); |
173 TextHitInfo hit = layout.hitTestChar(x - (float)alloc.getX(), 0); |
174 int pos = hit.getInsertionIndex(); |
174 int pos = hit.getInsertionIndex(); |
|
175 |
|
176 if (pos == v.getEndOffset()) { |
|
177 pos--; |
|
178 } |
|
179 |
175 biasReturn[0] = hit.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward; |
180 biasReturn[0] = hit.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward; |
176 return pos + v.getStartOffset(); |
181 return pos + v.getStartOffset(); |
177 } |
182 } |
178 |
183 |
179 /** |
184 /** |