UI element doesn't align perfectly


I created a canvas, with this settings:


Then, under this canvas I created a GameObject that has a 128x85 pixel image (let's say it's for the player inventory, PPU = 32). This GameObject is scaled to be 5 times bigger on both the X and Y axis.
My problem is that when I click on the image, I see a small gap between the lines and the image, like this:


I can't understand why this happens. If I go to the GameObject that has my image and input something like 0.121(...) for Pos Y, it kind of aligns. This does not happen on the X axis, there it aligns perfectly.

Any ideas? Maybe I'm drowning in a glass of water, but my OCD is killing me. I've tried multiple options but to no avail (changing the scale, changing reference resolution, changing UI Scale Mode, etc.)

Any help would be much appreciated.


The 2D forum is not related to UI. The forum for UI is here.

I'll move your post for you.

[quote=“MelvMay”, post:2, topic: 889369]
The 2D forum is not related to UI. The forum for UI is here.

I’ll move your post for you.
Thanks! Sorry for the mix up

1 Like