This patch fixes PR24340, so TableHeaders are painting properly again :)

2005-10-13  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicTableHeaderUI.java:
        (paint): Reset the clip of the Graphics object after each iteration.

--Tony
Index: javax/swing/plaf/basic/BasicTableHeaderUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicTableHeaderUI.java
--- javax/swing/plaf/basic/BasicTableHeaderUI.java	12 Oct 2005 12:10:00 -0000	1.9
+++ javax/swing/plaf/basic/BasicTableHeaderUI.java	13 Oct 2005 19:27:20 -0000
@@ -155,6 +155,7 @@
         Rectangle bounds = header.getHeaderRect(i);
         if (bounds.intersects(clip))
           {
+            Rectangle oldClip = gfx.getClipBounds();
             TableColumn col = cmod.getColumn(i);
             TableCellRenderer rend = col.getHeaderRenderer();
             if (rend == null)
@@ -171,10 +172,12 @@
             if (comp instanceof JComponent)
               ((JComponent)comp).setBorder(cellBorder);
             gfx.translate(bounds.x, bounds.y);
+            gfx.setClip(0, 0, bounds.width, bounds.height);
             comp.setSize(bounds.width, bounds.height);
             comp.setLocation(0,0);
             comp.paint(gfx);
             gfx.translate(-bounds.x, -bounds.y);
+            gfx.setClip(oldClip);
           }
       }
 
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to