Issue with CommonButtonBase resetting alignments on compile

I’ve created a child of CommonButtonBase and added a Common Text to it. I’m noticing however that whenever I set the horizontal and vertical alignment to be centered that when I compile it will reset back to fill on both alignments. Not sure what I’m doing wrong here.

This is before compiling:

This is after:

If anyone can let me know what I’m doing wrong then I’d appreciate it!

EDIT: Also if I run my build through Rider using Debug the code hits a debug breakpoint:

Based on the above debug message I assume it’s something to do with making a CommonText element as the root widget. I wrapped it in an Overlay and that seems to have solved it, but I imagine any widget type would work so long as the Text isn’t at the root anymore.

1 Like