6849232: closed/javax/swing/text/GlyphPainter2/6427244/bug6427244.java fails on RHEL5

Reviewed-by: peterz
This commit is contained in:
Pavel Porvatov 2011-04-06 20:36:22 +04:00
parent a37d4170e2
commit a54e99d9a7

View File

@ -172,6 +172,11 @@ class GlyphPainter2 extends GlyphView.GlyphPainter {
//italic carets and we do not.
TextHitInfo hit = layout.hitTestChar(x - (float)alloc.getX(), 0);
int pos = hit.getInsertionIndex();
if (pos == v.getEndOffset()) {
pos--;
}
biasReturn[0] = hit.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward;
return pos + v.getStartOffset();
}