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

This subforum contains all the issues which we already resolved.
User avatar
Shemp
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Jan 19, 2026 6:51 pm
Contact:

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

Post 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 197 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 197 times
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5509
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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
Rseding91
Factorio Staff
Factorio Staff
Posts: 17240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”