aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-20 18:08:28 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-20 18:08:28 +0300
commit04c47ecad68280765c7f2f8ca4833f199c6bd166 (patch)
treecc44f36ea8e69bad1fbc76135d82a020d79729d5 /src
parentae87b1554ab83d4e294afc614aca910d59fe9de7 (diff)
downloadLibGui-04c47ecad68280765c7f2f8ca4833f199c6bd166.tar.gz
LibGui-04c47ecad68280765c7f2f8ca4833f199c6bd166.tar.bz2
LibGui-04c47ecad68280765c7f2f8ca4833f199c6bd166.zip
Fix panels in scroll panels being the wrong size
Diffstat (limited to 'src')
-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;