classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: BasicTextUI fixlet


From: David Gilbert
Subject: Re: [cp-patches] FYI: BasicTextUI fixlet
Date: Wed, 09 Nov 2005 12:51:59 +0000
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051026)

Oddly, this seems to also have fixed a problem with the vertical alignment of text in editable JComboBoxes under the MetalLookAndFeel. I'm very happy about that...

Regards,

Dave

Roman Kennke wrote:

I committed this little fixlet for the BasicTextUI. This should solve the
problem with textfields where the text is slightly off when displaying
right-aligned.

2005-11-09  Roman Kennke  <address@hidden>

       * javax/swing/plaf/basic/BasicTextUI.java
       (getVisibleEditorRect): Correctly calculate the inner rectangle.

/Roman
------------------------------------------------------------------------

Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.52
diff -u -r1.52 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java     8 Nov 2005 15:03:11 -0000       
1.52
+++ javax/swing/plaf/basic/BasicTextUI.java     9 Nov 2005 10:19:42 -0000
@@ -831,10 +831,10 @@
  {
    Caret caret = textComponent.getCaret();
    Highlighter highlighter = textComponent.getHighlighter();
- +
    if (textComponent.isOpaque())
      paintBackground(g);
- +
    if (highlighter != null
        && textComponent.getSelectionStart() != textComponent.getSelectionEnd())
      highlighter.paint(g);
@@ -1064,8 +1064,8 @@
        
    Insets insets = textComponent.getInsets();
    return new Rectangle(insets.left, insets.top,
-                        width - insets.left + insets.right,
-                        height - insets.top + insets.bottom);
+                        width - insets.left - insets.right,
+                        height - insets.top - insets.bottom);
  }

  /**
------------------------------------------------------------------------

_______________________________________________
Classpath-patches mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/classpath-patches





reply via email to

[Prev in Thread] Current Thread [Next in Thread]