While hacking on text stuff and observing Sun's behaviour I noticed that
View.setSize() is always called before paint() by the RootView. That
makes sense, that makes sure that the layout of a view hierarchy is
updated correctly before painting anything.

2006-02-09  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicTextUI.java
        (RootView.paint): Call setSize() before painting the view.

/Roman
Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.66
diff -u -r1.66 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java	7 Feb 2006 15:34:29 -0000	1.66
+++ javax/swing/plaf/basic/BasicTextUI.java	9 Feb 2006 13:55:35 -0000
@@ -246,7 +246,11 @@
     public void paint(Graphics g, Shape s)
     {
       if (view != null)
-        view.paint(g, s);
+        {
+          Rectangle b = s.getBounds();
+          view.setSize(b.width, b.height);
+          view.paint(g, s);
+        }
     }
 
 

Reply via email to