From a18567600afdacbd367038c905ffefc10bc9bc85 Mon Sep 17 00:00:00 2001 From: Sychic <47618543+Sychic@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:09:10 -0400 Subject: [PATCH] ExampleGui: Fix sizing errors --- src/main/java/com/example/examplemod/ExampleGui.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/examplemod/ExampleGui.kt b/src/main/java/com/example/examplemod/ExampleGui.kt index b0743cf8..cf134413 100644 --- a/src/main/java/com/example/examplemod/ExampleGui.kt +++ b/src/main/java/com/example/examplemod/ExampleGui.kt @@ -378,7 +378,7 @@ class ExampleGui : WindowScreen(ElementaVersion.V2) { // of our parent would make us taller than we need. This is where [FillConstraint] comes in. // It will make sure we are the correct height to go exactly to the bottom of our parent, // the sticky note. - height = FillConstraint() + height = FillConstraint() - 1.pixels() } childOf this // Currently, text input areas will simply overflow if they have too much text inside them. @@ -407,6 +407,7 @@ class ExampleGui : WindowScreen(ElementaVersion.V2) { // As we've seen before, we could have used a [RelativeConstraint] here // and subtracted by 4 pixels, but this way, using a [FillConstraint] is a little easier to grasp. height = FillConstraint() - 2.pixels() + width = FillConstraint() - 2.pixels() }.onMouseClick { // When we click inside of this text area, we want to activate it. To do so, we need to make sure // that this text input has the Window's focus. This means that the Window will route keyboard