diff options
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java | 1 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java | 13 |
2 files changed, 5 insertions, 9 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java index 105c13b..367cab0 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/PaddingTestGui.java @@ -5,7 +5,6 @@ import io.github.cottonmc.cotton.gui.widget.WGridPanel; import io.github.cottonmc.cotton.gui.widget.WLabel; import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment; import io.github.cottonmc.cotton.gui.widget.data.Insets; - import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment; import net.minecraft.text.Text; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java index 121d042..22139e9 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java @@ -7,7 +7,6 @@ import io.github.cottonmc.cotton.gui.widget.data.Insets; * A panel that positions children in a grid. */ public class WGridPanel extends WPanelWithInsets { - private static final VisualLogger LOGGER = new VisualLogger(WGridPanel.class); /** @@ -29,17 +28,14 @@ public class WGridPanel extends WPanelWithInsets { /** * Constructs a grid panel with the default grid size. */ - public WGridPanel() { - } + public WGridPanel() {} /** * Constructs a grid panel with a custom grid size. * * @param gridSize the grid size in pixels */ - public WGridPanel(int gridSize) { - this.grid = gridSize; - } + public WGridPanel(int gridSize) { this.grid = gridSize; } /** @@ -50,13 +46,14 @@ public class WGridPanel extends WPanelWithInsets { * @param horizontalGap the horizontal gap between grid cells * @param verticalGap the vertical gap between grid cells */ - public void setGaps(int horizontalGap, int verticalGap) { + public WGridPanel setGaps(int horizontalGap, int verticalGap) { if (!this.children.isEmpty()) { LOGGER.warn("You can only change gaps before adding children to a WGridPanel"); - return; + return this; } this.horizontalGap = horizontalGap; this.verticalGap = verticalGap; + return this; } |