I committed the attached fix that moves the getComponentGraphics() fetch
from paintComponent() to paint(). Some simple tests show that this is
the right thing and it also fixes a problem with an app I have here.

2005-11-09  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/JComponent.java
        (paint): Fetch a new componentGraphics here instead of
        paintComponent.
        (paintComponent): Don't fetch the componentGraphics here. This
        must be done in paint.

/Roman
Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.77
diff -u -r1.77 JComponent.java
--- javax/swing/JComponent.java	8 Nov 2005 13:53:59 -0000	1.77
+++ javax/swing/JComponent.java	9 Nov 2005 14:41:55 -0000
@@ -1685,10 +1685,11 @@
       {
         if (g.getClip() == null)
           g.setClip(0, 0, getWidth(), getHeight());
-        paintComponent(g);
-        paintBorder(g);
-        paintChildren(g);
-        Rectangle clip = g.getClipBounds();
+        Graphics g2 = getComponentGraphics(g);
+        paintComponent(g2);
+        paintBorder(g2);
+        paintChildren(g2);
+        Rectangle clip = g2.getClipBounds();
         if (clip.x == 0 && clip.y == 0 && clip.width == getWidth()
             && clip.height == getHeight())
           RepaintManager.currentManager(this).markCompletelyClean(this);
@@ -1785,7 +1786,7 @@
         Graphics g2 = g;
         if (!(g instanceof Graphics2D))
           g2 = g.create();
-        ui.update(getComponentGraphics(g2), this);
+        ui.update(g2, this);
         if (!(g instanceof Graphics2D))
           g2.dispose();
       }
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to