From a018db6c699488aa9b9e392cd4515c97fade095a Mon Sep 17 00:00:00 2001 From: Falkreon Date: Fri, 30 Aug 2019 13:36:57 -0500 Subject: Implement panel clipping --- .../src/main/java/io/github/cottonmc/test/client/TestClientGui.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'GuiTest/src') 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 list = new WListPanel(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); -- cgit