Repository navigation
fix the widget span layout when text scale factor != 1 - #59711
Conversation
| // The content will be enlarged by textScaleFactor during painting phase. | ||
| // We reduce contraint by textScaleFactor so that the content will fit | ||
| // into the box once it is enlarged. | ||
| BoxConstraints(maxWidth: constraints.maxWidth) / textScaleFactor, |
There was a problem hiding this comment.
@GaryQian I wonder why do we need _textPainter.inlinePlaceholderScales? aren't they always the same as textScaleFactor?
There was a problem hiding this comment.
I believe that in actual use cases, it is indeed true, but it is also possible (at lower levels) to independently set them. This may or may not be necessary at this level, I can look into it to see if it is safe to remove.
There was a problem hiding this comment.
The scales are added into the list through WidgetSpan.build() which gets its value from the textScaleFactor. I couldn't find a possible way to have a different textscalefactor.
justinmc
left a comment
There was a problem hiding this comment.
Ah I see, thanks for the clarification. I do see the overflowing without this PR and it goes away on your branch. LGTM 👍
|
Wanted to confirm on a real world app that with what effectively is the flutter_html where the html_parser sees the scale factor implemented that. it does not wrap: When will we see the layout flow fix in the master branch? |
|
This may take a while, we are seeing a large number of test failure in our internal tests. we are in the middle of sorting this out. |
How is it going on the the tests on this one? If there is a build in master happy to do any tests and report back if you need. |
…er#59711)" (flutter#59986) This reverts commit 747fe34.


Description
The widget span is laid out with original size but enlarged after paint. This cause the content to flow out of the box.
Related Issues
Fixes #59316
Tests
I added the following tests:
Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See Test Coverage.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.