-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Remove more textScaleFactor references #141816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove more textScaleFactor references #141816
Conversation
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to wonder if there shouldn't be a getter for effective scale on TextScaler.
Something like below to avoid bugs like I commented on:
double getEffectiveScale(double fontSize) => scale(fontSize)/fontSize;| )!; | ||
| EdgeInsetsGeometry? get labelPadding { | ||
| final double defaultFontSize = labelStyle?.fontSize ?? 14.0; | ||
| final double effectiveTextScale = MediaQuery.textScalerOf(context).scale(defaultFontSize) / 14.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be divided by the defaultFontSize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think in this case I meant to scale the padding with the actual font size, since the threshold padding values seem to be empirical values that work well with the default font size, so making the font size larger should scale the padding the same way as increasing the text scale. I'll add comments in the code and update the PR description.
| )!; | ||
| EdgeInsetsGeometry? get labelPadding { | ||
| final double defaultFontSize = labelStyle?.fontSize ?? 14.0; | ||
| final double effectiveTextScale = MediaQuery.textScalerOf(context).scale(defaultFontSize) / 14.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be divided by the defaultFontSize?
| )!; | ||
| EdgeInsetsGeometry? get labelPadding { | ||
| final double defaultFontSize = labelStyle?.fontSize ?? 14.0; | ||
| final double effectiveTextScale = MediaQuery.textScalerOf(context).scale(defaultFontSize) / 14.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be divided by the defaultFontSize?
| )!; | ||
| EdgeInsetsGeometry? get labelPadding { | ||
| final double defaultFontSize = labelStyle?.fontSize ?? 14.0; | ||
| final double effectiveTextScale = MediaQuery.textScalerOf(context).scale(defaultFontSize) / 14.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be divided by the defaultFontSize?
| visualDensity = VisualDensity(vertical: visualDensity.vertical); | ||
| } | ||
| final double defaultFontSize = Theme.of(context).textTheme.labelLarge?.fontSize ?? 14.0; | ||
| final double effectiveTextScale = MediaQuery.textScalerOf(context).scale(defaultFontSize) / 14.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be divided by the defaultFontSize?
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flutter/flutter@684247a...ddf60fb 2024-01-20 [email protected] Roll Flutter Engine from 1385f76018ab to 704ef3399012 (1 revision) (flutter/flutter#141932) 2024-01-20 [email protected] Roll Flutter Engine from 6f6649bdfef2 to 1385f76018ab (1 revision) (flutter/flutter#141926) 2024-01-20 [email protected] Roll Flutter Engine from 4d67f267b115 to 6f6649bdfef2 (1 revision) (flutter/flutter#141920) 2024-01-20 [email protected] Roll Flutter Engine from 53a2436cf75c to 4d67f267b115 (1 revision) (flutter/flutter#141917) 2024-01-20 [email protected] Roll Flutter Engine from a9b87c6288d2 to 53a2436cf75c (1 revision) (flutter/flutter#141916) 2024-01-20 [email protected] Roll Flutter Engine from d00e55f7f8ed to a9b87c6288d2 (3 revisions) (flutter/flutter#141914) 2024-01-20 [email protected] Remove more textScaleFactor references (flutter/flutter#141816) 2024-01-19 [email protected] Roll Flutter Engine from 517fc2bbfa51 to d00e55f7f8ed (1 revision) (flutter/flutter#141909) 2024-01-19 [email protected] Roll Flutter Engine from f2b441a26416 to 517fc2bbfa51 (2 revisions) (flutter/flutter#141904) 2024-01-19 [email protected] Fix "Delete" tooltip is shown disabled on chips with `onDeleted` callback (flutter/flutter#141770) 2024-01-19 [email protected] Run module_test_ios on arm and x64 (flutter/flutter#141815) 2024-01-19 [email protected] `SearchAnchor` search view clear button only shows up when text input is not empty (flutter/flutter#141755) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Remove more
textScaleFactorreferences from flutter/flutter.textScaleFactorscalar, now they scale with the font size and are still capped at the original "max" and "min" values.textScaleFactor, these are replaced by an effective text scale factor computed using a default font size (which is determined in a pretty random fashion, but it will only make a difference on Android 14+).No API changes in this batch. There are still some references left that I intend to remove in a different batch that would introduce API changes.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.