How to scale button from the center inside an AspectRatioContainer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lukas0842

I’m trying to add an animation to my buttons, which makes the button bigger when the mouse is hovering over the button. I haven’t seen any built-in functionality in the button node to do that so I’m using an AnimationPlayer and the mouse_entered/mouse_exited signals to achieve this effect.
My problem is, when I add the button to a GridContainer it always scales from the top left corner, even though I have set the pivot offset and the position correctly in the center. When I try this with the button only and no GridContainer it works fine. How do I fix this?