You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem can be solved by moving the setSize call after validate.
But there is still a problem when adding a WBox to another Wbox.
var root = new WBox(Axis.HORIZONTAL);
setRootPanel(root);
var box = new WBox(Axis.HORIZONTAL);
box.setInsets(Insets.ROOT_PANEL);
box.setHorizontalAlignment(HorizontalAlignment.RIGHT);
box.add(new WButton());
root.add(box, 200, 40);
root.validate(this);
root.setSize(200, 240);
If horizontalAlignment is LEFT, there is a gap between the button and the left border; If it's RIGHT, no gap between the button and the right border.
I found that change line 90 of WBox.java to dimension = getWidth() - widgetWidth - insets.right(); can solve these problems.
Describe the bug
The number of pixels expanded to the right is the same as the horizontal size of the insets.
To Reproduce
Add these code to the subclass of LightweightGuiDescription:
If horizontalAlignment is LEFT, the width is 200; If it's RIGHT, the width is 207.
Expected behavior
Fix the width of WBox.
Version of the (please complete the following information):
-LibGui 6.3.0
-Fabric api 0.61.0
-Minecraft 1.19.2
Additional context
This problem can be solved by moving the setSize call after validate.
The text was updated successfully, but these errors were encountered: