From 04c47ecad68280765c7f2f8ca4833f199c6bd166 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Wed, 20 May 2020 18:08:28 +0300 Subject: Fix panels in scroll panels being the wrong size --- src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java index 9ff61a6..bff7987 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java @@ -89,6 +89,7 @@ public class WScrollPanel extends WClippedPanel { horizontalScrollBar.setLocation(0, this.height - horizontalScrollBar.getHeight()); horizontalScrollBar.setSize(scrollingVertically ? (this.width - verticalScrollBar.getWidth()) : this.width, 8); + if (widget instanceof WPanel) ((WPanel) widget).layout(); children.add(widget); int x = scrollingHorizontally ? -horizontalScrollBar.getValue() : 0; int y = scrollingVertically ? -verticalScrollBar.getValue() : 0; -- cgit