Skip to content

Conversation

@tkzcfc
Copy link
Contributor

@tkzcfc tkzcfc commented Oct 22, 2025

fix: #2830

@aismann
Copy link
Contributor

aismann commented Oct 22, 2025

@tkzcfc
Is this not better: replace < with !=?
getRenderingFontSize() != _originalFontSize)

@tkzcfc
Copy link
Contributor Author

tkzcfc commented Oct 22, 2025

I referenced the existing code logic from our codebase (line 2111 in Label.cpp), which specifically checks for the shrink overflow scenario when the current rendering font size is smaller than the original.

The condition this->getRenderingFontSize() < _originalFontSize is intentional because:

  • If the rendering size is already equal to the original size, no rescaling is needed

  • If the rendering size is larger than the original, we also don't want to trigger rescaling in this shrink overflow scenario

  • We only want to rescale when the current size has become smaller than the original

@halx99 halx99 added this to the 2.9.1 milestone Oct 22, 2025
@halx99 halx99 added the bug Something isn't working label Oct 22, 2025
@halx99 halx99 merged commit ef16b6b into axmolengine:release/2.x Oct 22, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ui::Text] Overflow::SHRINK does not restore the original font size when text is shortened

3 participants