UIScale/UITextSizeConstraint Precedence

Ever since the recent change to TextBounds, I’ve noticed that TextBounds will always be set to the absolute-shown size of fonts, regardless of any UIScale object acting on that text.


This caused a few bugs in my game when released, but that’s because I was manually multiplying TextBounds by the scale I had set with my UIScale to get the absolute TextBounds (TextBounds now always shows the absolute TextBounds, regardless of UIScale shinking/growing the text).

It turns out this change also affects UITextSizeConstraint objects, in that UITextSizeConstraints will apply after a UIScale constraint object’s effects, rather than before.

I use UIScale to easily design UI for the smallest supported screen size, and scale up to arbitrary screen sizes when needed, while keeping everything looking the same. This means I usually expect UIScale to always show its decendants consistently. However, with the new TextBounds changes, UITextSizeConstraints no longer respect this scaling, and instead limit the TextSize absolutely:
Old behavior (should look the same no matter what resolution it is scaled up to):
image
New behavior:
image

The setup looks something like this:
image
image
“ButtonText” has “TextScaled” set to true so it can scale down to any size, but can only scale up to size 20.

If you had removed the constraint, disabled TextScaled, and set the TextSize to 20 manually, it would show this:
image

However, since UITextSizeConstraint checks against the absolute TextBounds rather than the actual TextSize property, it shows up like this, even though the TextSize should, according to the constraint, scale up to 20 relatively:
image

8 Likes

Hi @DataBrain - there were indeed some major changes deployed that impacted text layout as you noted, and it looks like this issue could be caused by it. Thank you for the detailed report, I created a ticket to investigate this issue!

1 Like

I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved? We are having a hard time reproducing this issue.

1 Like

I can confirm, this is still happening.
Here is a repro file:
Baseplate.rbxl (23.3 KB)

Alright i will pass that rbx file to engineering. When there is an update i will let you know.

1 Like