LibGui icon indicating copy to clipboard operation
LibGui copied to clipboard

Incorrect root `WBox` insets with alignment

Open Phoupraw opened this issue 2 years ago • 0 comments

Describe the bug Root WBox is smaller than expected when center aligned.

To Reproduce Steps to reproduce the behavior:

  1. Create a gui desc and a screen.
  2. Use WBox as root.
  3. setHorizontalAlignment(HorizontalAlignment.CENTER)
  4. See error

Expected behavior Optional Should be normal as left aligned.

Screenshots Optional

WBox root = new WBox(Axis.VERTICAL).setHorizontalAlignment(HorizontalAlignment.XXX).setInsets(INSETS);
setRootPanel(root);
root.add(new WItemStorageSlot(blockInventory,0,5,1,false,blockEntity.storage.parts));
root.add(createPlayerInventoryPanel());
root.validate(this);

LEFT 2024-01-06_19 20 22

CENTER 2024-01-06_19 21 55

Version of the (please complete the following information):

  • amecs 1.3.9+mc.1.20-pre2 -- amecsapi 1.4.0+mc1.20-pre1
  • cloth-config 11.1.106 -- cloth-basic-math 0.6.1
  • devauth 1.1.2 |-- com_electronwill_night-config_core 3.6.5 |-- com_electronwill_night-config_toml 3.6.5 -- me_djtheredstoner_common_ 1.1.2
  • emi 1.0.29+1.20.1+fabric
  • fabric-api 0.91.0+1.20.1
  • fabric-api-base 0.4.30+7abfd51577
  • fabric-api-lookup-api-v1 1.6.35+4d8536c977
  • fabric-biome-api-v1 13.0.12+215bbe9677
  • fabric-block-api-v1 1.0.10+92a0d36777
  • fabric-block-view-api-v2 1.0.0+92a0d36777
  • fabric-blockrenderlayer-v1 1.1.40+b3afc78b77
  • fabric-client-tags-api-v1 1.1.1+97bb207577
  • fabric-command-api-v1 1.2.33+f71b366f77
  • fabric-command-api-v2 2.2.12+b3afc78b77
  • fabric-commands-v0 0.2.50+df3654b377
  • fabric-containers-v0 0.1.63+df3654b377
  • fabric-content-registries-v0 4.0.10+57aed33f77
  • fabric-convention-tags-v1 1.5.4+a1a980da77
  • fabric-crash-report-info-v1 0.2.18+aeb40ebe77
  • fabric-data-generation-api-v1 12.3.3+d7b148e077
  • fabric-dimensions-v1 2.1.53+8536527b77
  • fabric-entity-events-v1 1.5.22+b3afc78b77
  • fabric-events-interaction-v0 0.6.1+e91849a877
  • fabric-events-lifecycle-v0 0.2.62+df3654b377
  • fabric-game-rule-api-v1 1.0.39+ae9f657a77
  • fabric-gametest-api-v1 1.2.12+b3afc78b77
  • fabric-item-api-v1 2.1.27+b3afc78b77
  • fabric-item-group-api-v1 4.0.11+d7b148e077
  • fabric-key-binding-api-v1 1.0.36+fb8d95da77
  • fabric-keybindings-v0 0.2.34+df3654b377
  • fabric-lifecycle-events-v1 2.2.21+b3afc78b77
  • fabric-loot-api-v2 1.2.0+96dfa95977
  • fabric-loot-tables-v1 1.1.44+9e7660c677
  • fabric-message-api-v1 5.1.8+d7b148e077
  • fabric-mining-level-api-v1 2.1.49+b3afc78b77
  • fabric-model-loading-api-v1 1.0.2+709a987177
  • fabric-models-v0 0.4.1+9386d8a777
  • fabric-networking-api-v1 1.3.10+eeb8eb3677
  • fabric-networking-v0 0.3.50+df3654b377
  • fabric-object-builder-api-v1 11.1.2+4ee0bc6077
  • fabric-particles-v1 1.1.1+201a23a077
  • fabric-recipe-api-v1 1.0.20+b3afc78b77
  • fabric-registry-sync-v0 2.3.2+4df89eb277
  • fabric-renderer-api-v1 3.2.0+39a511ba77
  • fabric-renderer-indigo 1.5.0+39a511ba77
  • fabric-renderer-registries-v1 3.2.45+df3654b377
  • fabric-rendering-data-attachment-v1 0.3.36+92a0d36777
  • fabric-rendering-fluids-v1 3.0.27+b3afc78b77
  • fabric-rendering-v0 1.1.48+df3654b377
  • fabric-rendering-v1 3.0.7+b3afc78b77
  • fabric-resource-conditions-api-v1 2.3.7+29de845d77
  • fabric-resource-loader-v0 0.11.9+132c48c177
  • fabric-screen-api-v1 2.0.7+b3afc78b77
  • fabric-screen-handler-api-v1 1.3.29+b3afc78b77
  • fabric-sound-api-v1 1.0.12+b3afc78b77
  • fabric-transfer-api-v1 3.3.3+c81d263177
  • fabric-transitive-access-wideners-v1 4.3.0+6c31357e77
  • fabricloader 0.15.0
  • iceberg 1.1.15
  • jankson 6.0.0+j1.2.3
  • java 17
  • jecharacters 1.20.1-4.3.14 -- com_github_towdium_pinin 1.6.0
  • libgui 8.1.0+1.20.1
  • libninepatch 1.2.0
  • minecraft 1.20.1
  • mixinextras 0.3.0
  • modmenu 7.2.2
  • owo 0.11.2+1.20
  • trifle_utility ${version}
  • yet_another_config_lib_v3 3.2.1+1.20 |-- com_twelvemonkeys_common_common-image 3.10.0-SNAPSHOT |-- com_twelvemonkeys_common_common-io 3.10.0-SNAPSHOT |-- com_twelvemonkeys_common_common-lang 3.10.0-SNAPSHOT |-- com_twelvemonkeys_imageio_imageio-core 3.10.0-SNAPSHOT |-- com_twelvemonkeys_imageio_imageio-metadata 3.10.0-SNAPSHOT |-- com_twelvemonkeys_imageio_imageio-webp 3.10.0-SNAPSHOT |-- org_quiltmc_parsers_gson 0.2.1 -- org_quiltmc_parsers_json 0.2.1

Additional context Optional My current solution:

WBox root = new WBox(Axis.VERTICAL).setInsets(INSETS);
setRootPanel(root);
WBox vBox = new WBox(Axis.VERTICAL).setHorizontalAlignment(HorizontalAlignment.CENTER);
root.add(vBox);
vBox.add(new WItemStorageSlot(blockInventory, 0, 5, 1, false, blockEntity.storage.parts));
vBox.add(createPlayerInventoryPanel());
root.validate(this);

2024-01-06_19 30 08

Phoupraw avatar Jan 06 '24 11:01 Phoupraw