aboutsummaryrefslogtreecommitdiff
path: root/GuiTest/src
diff options
context:
space:
mode:
authorFalkreon <falkreon@gmail.com>2019-08-30 13:36:57 -0500
committerFalkreon <falkreon@gmail.com>2019-08-30 13:36:57 -0500
commita018db6c699488aa9b9e392cd4515c97fade095a (patch)
treec0381c0b56bad5df79865b6d94f05227b74736d2 /GuiTest/src
parentf31ed14fa9bcd45f1509c709ca51ce3c2aa4b6cf (diff)
downloadLibGui-a018db6c699488aa9b9e392cd4515c97fade095a.tar.gz
LibGui-a018db6c699488aa9b9e392cd4515c97fade095a.tar.bz2
LibGui-a018db6c699488aa9b9e392cd4515c97fade095a.zip
Implement panel clipping
Diffstat (limited to 'GuiTest/src')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
index d1b8bca..4c16b81 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
@@ -23,7 +23,7 @@ public class TestClientGui extends LightweightGuiDescription {
@Environment(EnvType.CLIENT)
public static final BackgroundPainter PANEL = (x, y, panel)->{
- ScreenDrawing.drawBeveledPanel(x, y, panel.getWidth(), panel.getHeight());
+ ScreenDrawing.drawBeveledPanel(x-1, y-1, panel.getWidth()+2, panel.getHeight()+2);
};
private static final Identifier PORTAL1 = new Identifier("libgui-test:portal.png");
@@ -69,6 +69,7 @@ public class TestClientGui extends LightweightGuiDescription {
};
WListPanel<String, PortalDestination> list = new WListPanel<String, PortalDestination>(data, PortalDestination.class, PortalDestination::new, configurator);
list.setListItemHeight(2*18);
+ list.setBackgroundPainter(PANEL);
root.add(list, 0, 2, 7, 6);
root.add(new WButton(new LiteralText("Teleport")), 3,8,4,1);