changeset 3958:f7eb08bf41e5

6849232: closed/javax/swing/text/GlyphPainter2/6427244/bug6427244.java fails on RHEL5 Reviewed-by: peterz
author rupashka
date Wed, 06 Apr 2011 20:36:22 +0400
parents cd853175b58c
children cebbb13e9963
files src/share/classes/javax/swing/text/GlyphPainter2.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/text/GlyphPainter2.java	Wed Apr 06 15:12:33 2011 +0400
+++ b/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();
     }