Download

Grid panel slots sizing issue

Anyone else notice that the slots for grid panels do not take up the proper screen space when there are unfilled slots in the grid panel? I’m not sure if this behaviour is intentional, but I don’t remember this happening for earlier versions of the engine (4.17-4.19). I’m getting this problem in 4.23 and 4.24. I haven’t checked -4.22 or 4.25. Some reproduction steps are:

  1. Create a new user widget and open it for editing.

  2. Delete the default root canvas panel and add a grid panel as the root widget in the new user widget’s heirarchy.

  3. Add 3 array elements to the ‘Column Fill’ array under the ‘Fill Rules’ section in the details tab of the grid panel.

  4. Make the corresponding element values 0.2, 0.2, and 0.6, respectively.

  5. Add 3 array elements to the ‘Row Fill’ array under the ‘Fill Rules’ section in the details tab of the grid panel.

  6. Make the corresponding element values 0.2, 0.4, and 0.4, respectively

  7. Add a border(B1) widget, or any other widget, to the grid panel.

  8. This step is optional but makes it easier to see the overall size of the grid slot being occupied. Set both the ‘Horizontal Alignment’ and ‘Vertical Alignment’ to ‘Fill’ within the ‘Slot(GridSlot)’ section in the details tab of B1.

  9. Set ‘Row’, ‘Row Span’, ‘Column’, and ‘Column Span’ equal to 0, 1, 0, and 1 within the ‘Slot(GridSlot)’ section in the details tab of B1.

Problem: B1 is now taking up ~50% of the width and ~30% of the height of the grid panel’s screen space. It should be taking up 20% of the width and height based on the grid panel fill rules.

  1. Add a border(B2) widget, or any other widget, to the grid panel.so far

  2. This step is optional but makes it easier to see the overall size of the grid slot being occupied. Set both the ‘Horizontal Alignment’ and ‘Vertical Alignment’ to ‘Fill’ within the ‘Slot(GridSlot)’ section in the details tab of B2.

  3. Set ‘Row’, ‘Row Span’, ‘Column’, and ‘Column Span’ equal to 1, 1, 1, and 1 within the ‘Slot(GridSlot)’ section in the details tab of B2.

Note: B1 should be using the proper amount of the grid panel’s screen space, 20% width and height. B2 should also be the appropriate height.

1 Like

Bump. This bug(?) still happens in 4.26.0.

I’ve been running into the same issue as well, but was able to solve it

in my case i was using the grid panel for a grid inventory (which needed to display an exactly 3x5 grid)
create 1.0 fill rules for the desired size, for me it was 5 rows, 3 columns
at runtime before you populate your panel
create a new inventory widget that takes up one slot
then add this dummy widget to the panel
set the widgets position to the maximum that the panel should allow the [2,4] position
the widget is then removed and the grid can be populated with real entries like normal

this seems to be a bug with updating the fill rules at runtime, as the panel behaves almost like a uniform grid panel when enough fill rules are added and the last row and column have not yet been rescaled