This fixes the Y location for the underlining line in
BasicGraphicsUtil.drawStringUnderlineCharAt(). Before it drew the line
anywhere but not below the string. This is fixed now.

2007-09-21  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicGraphicsUtils.java
        (drawStringUnderlineCharAt): Fix Y location of underline.

/Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
Index: javax/swing/plaf/basic/BasicGraphicsUtils.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java,v
retrieving revision 1.19
diff -u -1 -0 -r1.19 BasicGraphicsUtils.java
--- javax/swing/plaf/basic/BasicGraphicsUtils.java	17 Aug 2006 14:45:46 -0000	1.19
+++ javax/swing/plaf/basic/BasicGraphicsUtils.java	21 Sep 2007 08:42:07 -0000
@@ -635,21 +635,21 @@
       /* Fall-back. This is likely to produce garbage for any text
        * containing right-to-left (Hebrew or Arabic) characters, even
        * if the underlined character is left-to-right.
        */
       g.drawString(text, x, y);
       if (drawUnderline)
       {
         fmet = g.getFontMetrics();
         g.fillRect(
           /* x */ x + fmet.stringWidth(text.substring(0, underlinedIndex)),
-          /* y */ y + fmet.getDescent() - 1,
+          /* y */ y + 1,
           /* width */ fmet.charWidth(text.charAt(underlinedIndex)),
           /* height */ 1);
       }
 
       return;
     }
 
     g2 = (Graphics2D) g;
     font = g2.getFont();
     frc = g2.getFontRenderContext();

Reply via email to