aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollPanel.java1
1 files changed, 1 insertions, 0 deletions
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;