Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExampleGui: Fix sizing errors #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/com/example/examplemod/ExampleGui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down