Weird padding behaviour of Image inside Button

Hi there!

Currently got a weird issue with my Image inside of a Button.

So this is how it theoretically should look like:


Notice that I padded top and bottom to 10, didnt do anything on left or right.
So its a guessed padding to make it somewhat square.

this is how it looks like without any padding:

Question is, where do these weird sidebars left and right come from?
I dont have any padding in any of the parents so why is it behaving like that?

I would like the picture to scale with the sizebox, or at least be squared.

If any additional info is needed, please let me know.

And thank you very much for interacting with this question!!

Hey @Shykaro!

I think it might be related to the shape of the original image. Try cropping it to be square first! (In the screenshot the image is 384x,512y, so it’s taller than it is wide)

Give that a shot and let us know how it goes!

1 Like

Hi there!

Thank you so much for your answer, i sadly already tried that. And it didnt seem to change anything :frowning:

The image iam loading in, with the original thumbnail bind has the properties of 128x128 as well, but its stretched ingame too.

(With original settings):
image

EDIT: Both tested in “Desired on Screen” btw

The button itself has custom padding for Normal and Pressed state, try setting that to 0.
image

EDIT : You’ll need to compile to see the changes!

Image Padding = 10 | Button Normal Padding = 12.0, 1.5
image

Image Padding = 10 | Button Normal Padding = 0
image

1 Like

Also, instead of adding a child image, you can simply use the image property on the button itself!

image

1 Like

Yep, that was indeed the issue that i couldnt find. Thank you all very much :slight_smile: !

1 Like

Thanks a lot !