diff options
Diffstat (limited to 'libjava/java/awt/BorderLayout.java')
-rw-r--r-- | libjava/java/awt/BorderLayout.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libjava/java/awt/BorderLayout.java b/libjava/java/awt/BorderLayout.java index 38e4de742a0..a023cbb059b 100644 --- a/libjava/java/awt/BorderLayout.java +++ b/libjava/java/awt/BorderLayout.java @@ -592,13 +592,21 @@ layoutContainer(Container target) int x1 = i.left; int x2 = x1 + w.width + hgap; - int x3 = Math.max(x2 + w.width + hgap, t.width - i.right - e.width); + int x3; + if (t.width <= i.right + e.width) + x3 = x2 + w.width + hgap; + else + x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int midh = Math.max(e.height, Math.max(w.height, c.height)); - int y3 = Math.max(y2 + midh + vgap, t.height - i.bottom - s.height); + int y3; + if (t.height <= i.bottom + s.height) + y3 = y2 + midh + vgap; + else + y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); |