UniformGridPanel slot padding producing uneven borders (UE 5.7)

I’ve been trying to implement a UniformGridPanel which dynamically displays an inventory of items.

The data is looking great, but I’m struggling to get the UniformGridPanel to look as expected.

I’m placing the grid within a border for the overall background. Each slot contains the separate “slot” widget containing the item icon within a border - to give an empty slot a background colour.

What I’m seeing is that when I apply slot padding to space the grid out - the border edges are never consistent, some sides of the slots are larger than the rest.

As an example, I’ve just put left padding on the slot, and you can see the blue edges of the grid items aren’t the same:

Slot padding 2

Slot padding 0

eg Column A + B is different than column C.

Here is the structure of the widgets:

Inventory Window

Inventory Slot

Can anyone figure out why this is happening?

Have I just got the wrong combination of widget components?

After further debugging this appears to be related to the UI DPI scaling. Setting 1080p worked great - but setting 1440p produced the above, due to the sizing after scaling ending up in “.5” values, some would round up and some round down.

My solution currently is to create the border as a texture and remove all padding outside of the grid. The texture includes 2px of transparent edge with 2px of border and then I just needed to pad my icons by 2px to fit inside the border.

Hopefully this was the right approach!