Skip to content

Conversation

@j-piasecki
Copy link
Contributor

Summary:
Changelog: [Android][Fixed] Fixed adjustsFontSizeToFit scaling the font size too much down

Fixes #54356

Previous implementation was always using the starting font size as base for calculating ratio and was applying it to the already scaled down font sizes in each iteration. This caused the text size to be scaled down too aggresively.

In this diff I changed the implementation to use the font size from the previous iteration for calculating the scale ratio to fix that. I also updated it to use binary seach instead of linear search for finding the largest fitting font size.

Differential Revision: D87973778

Summary:
Changelog: [Android][Fixed] Fixed `adjustsFontSizeToFit` scaling the font size too much down

Fixes facebook#54356

Previous implementation was always using the starting font size as base for calculating ratio and was applying it to the already scaled down font sizes in each iteration. This caused the text size to be scaled down too aggresively.

In this diff I changed the implementation to use the font size from the previous iteration for calculating the scale ratio to fix that. I also updated it to use binary seach instead of linear search for finding the largest fitting font size.

Differential Revision: D87973778
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 27, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 27, 2025

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87973778.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adjustsFontSizeToFit do not work correctly on Android

2 participants