aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
index 32e56c4..7c92191 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java
@@ -111,8 +111,7 @@ public class WListPanel<D, W extends WWidget> extends WClippedPanel {
if (cellHeight<4) cellHeight=4;
int layoutHeight = this.getHeight()-(margin*2);
- int cellsHigh = layoutHeight / cellHeight;
-
+ int cellsHigh = Math.max(layoutHeight / cellHeight, 1); // At least one cell is always visible
//System.out.println("Adding children...");