6849232: closed/javax/swing/text/GlyphPainter2/6427244/bug6427244.java fails on RHEL5
Reviewed-by: peterz
--- a/jdk/src/share/classes/javax/swing/text/GlyphPainter2.java Wed Apr 06 15:12:33 2011 +0400
+++ b/jdk/src/share/classes/javax/swing/text/GlyphPainter2.java Wed Apr 06 20:36:22 2011 +0400
@@ -172,6 +172,11 @@
//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();
}