diff options
Diffstat (limited to 'libjava/classpath/javax/swing/ViewportLayout.java')
-rw-r--r-- | libjava/classpath/javax/swing/ViewportLayout.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libjava/classpath/javax/swing/ViewportLayout.java b/libjava/classpath/javax/swing/ViewportLayout.java index 884f7cb27a8..79fd26c56df 100644 --- a/libjava/classpath/javax/swing/ViewportLayout.java +++ b/libjava/classpath/javax/swing/ViewportLayout.java @@ -143,32 +143,32 @@ public class ViewportLayout implements LayoutManager, Serializable Dimension viewMinimum = view.getMinimumSize(); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); - + // vertical implementation of the above rules + if ((! (view instanceof Scrollable) && viewPref.height < portBounds.height + || (view instanceof Scrollable + && ((Scrollable) view).getScrollableTracksViewportHeight()))) + viewPref.height = portBounds.height; + if (portBounds.height >= viewMinimum.height) - { - portBounds.y = 0; - if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) - viewPref.height = portBounds.height; - } + portBounds.y = 0; else { - viewPref.height = viewMinimum.height; int overextension = portLowerRight.y - viewPref.height; if (overextension > 0) portBounds.y -= overextension; } // horizontal implementation of the above rules + if ((! (view instanceof Scrollable) && viewPref.width < portBounds.width + || (view instanceof Scrollable + && ((Scrollable) view).getScrollableTracksViewportWidth()))) + viewPref.width = portBounds.width; + if (portBounds.width >= viewMinimum.width) - { - portBounds.x = 0; - if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) - viewPref.width = portBounds.width; - } + portBounds.x = 0; else { - viewPref.width = viewMinimum.width; int overextension = portLowerRight.x - viewPref.width; if (overextension > 0) portBounds.x -= overextension; |