aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WGridPanel.java15
1 files changed, 9 insertions, 6 deletions
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 a3fcf94..61adddf 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
@@ -1,27 +1,30 @@
package io.github.cottonmc.cotton.gui.widget;
public class WGridPanel extends WPanel {
+ protected int grid = 18;
+
+ public WGridPanel() {}
+ public WGridPanel(int gridSize) { this.grid = gridSize; }
+
public void add(WWidget w, int x, int y) {
children.add(w);
w.parent = this;
- w.setLocation(x * 18, y * 18);
+ w.setLocation(x * grid, y * grid);
if (w.canResize()) {
- w.setSize(18, 18);
+ w.setSize(grid, grid);
}
expandToFit(w);
- //valid = false;
}
public void add(WWidget w, int x, int y, int width, int height) {
children.add(w);
w.parent = this;
- w.setLocation(x * 18, y * 18);
+ w.setLocation(x * grid, y * grid);
if (w.canResize()) {
- w.setSize(width * 18, height * 18);
+ w.setSize(width * grid, height * grid);
}
expandToFit(w);
- //valid = false;
}
} \ No newline at end of file