Hi,

This is a small fix for the ViewportLayout. As it was before, the layout
manager sets the size for the view to it's minimum when the port is
smaller thant the view. This can't be correct. To be honest, I think it
still isn't correct now, I don't have time to investigate more atm and
it seems to work better than before, so I commit this. For the possible
bug I added a comment.

2005-12-06  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/ViewportLayout.java
        (layoutContainer): Don't set the view to it's minimumSize when
the
        port is larger than the view. Rather it should left at it's
        preferred size. Also, I added a comment explaining a possible bug
        in this method.

Cheers, Roman
Index: javax/swing/ViewportLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/ViewportLayout.java,v
retrieving revision 1.18
diff -u -r1.18 ViewportLayout.java
--- javax/swing/ViewportLayout.java	26 Oct 2005 19:40:26 -0000	1.18
+++ javax/swing/ViewportLayout.java	6 Dec 2005 14:30:07 -0000
@@ -153,7 +153,6 @@
       }
     else
       {
-        viewPref.height = viewMinimum.height;
         int overextension = portLowerRight.y - viewPref.height;
         if (overextension > 0)
             portBounds.y -= overextension;
@@ -168,13 +167,17 @@
       }
     else
       {
-        viewPref.width = viewMinimum.width;
         int overextension = portLowerRight.x - viewPref.width;
         if (overextension > 0)
             portBounds.x -= overextension;
       }
 
     port.setViewPosition(portBounds.getLocation());
+    // TODO: I doubt that the size should really be touched here, except when
+    // the view is somehow smaller than its minimumSize. I would think that
+    // when the size of a view is set manually to a fixed value, that this
+    // value should be left unchanged, and not reset to the preferred or
+    // minimum size. -- Roman Kennke
     port.setViewSize(viewPref);
   }
 }
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to