Page 1 of 1

[2.1.11] "inventory" LuaGuiElement always draws a second row even if all slots fit into one

Posted: Sun Jul 19, 2026 7:13 pm
by Shemp
Steps to reproduce:
  • Enter a world and place a Requester chest
  • Hover over the chest and run
  • /c chest = game.player.selected
  • Create a mod GUI inventory with the commands
  • /c frame = game.player.gui.screen.add{type = "frame", caption = "Test"}
  • /c inv = frame.add{type = "inventory", slots_per_row = 20}
  • /c inv.inventory = chest.get_inventory(defines.inventory.logistic_container_trash)
inventory-extra-row.png
inventory-extra-row.png (5.59 KiB) Viewed 200 times
The inventory is able to draw all of its slots in one row, but still draws an entire row of placeholder slots underneath.

Changing the inventory width to a smaller value to require more rows produces the expected behaviour, where placeholder slots are drawn only to fill the remainder of rows.
/c inv.slots_per_row = 12
inventory-double-row.png
inventory-double-row.png (8.82 KiB) Viewed 200 times

Re: [2.1.11] "inventory" LuaGuiElement always draws a second row even if all slots fit into one

Posted: Sun Jul 19, 2026 7:25 pm
by Klonan
Yea the shallow slots scroll pane style has a minimal height of 2 slots:
`minimal_height = slot_size * 2`

In the base game usage we don't really do smaller ones

I guess for CustomInventory we can just clear the `minimal height` in the scroll pane style

Re: [2.1.11] "inventory" LuaGuiElement always draws a second row even if all slots fit into one

Posted: Sun Jul 19, 2026 8:30 pm
by Rseding91
This was fixed in master yesterday. I just changed it to have a min height of 1 row and if mods want more, they can set it larger.