Do not paint a RenderFittedBox with an empty size#7489
Merged
jason-simmons merged 1 commit intoflutter:masterfrom Jan 13, 2017
Merged
Do not paint a RenderFittedBox with an empty size#7489jason-simmons merged 1 commit intoflutter:masterfrom
jason-simmons merged 1 commit intoflutter:masterfrom
Conversation
Member
Author
Contributor
Contributor
|
Test? |
Contributor
|
You can build it with a custom painter inside and check that hte custom painter doesn't paint. |
Hixie
reviewed
Jan 13, 2017
Contributor
There was a problem hiding this comment.
This doesn't seem right. Surely if the size is empty you're more likely to have overflow.
Contributor
There was a problem hiding this comment.
In particular I suspect this will break localToGlobal for things inside a zero-size RenderFittedBox.
Contributor
There was a problem hiding this comment.
We skip painting the child entirely, so there's no chance of visual overflow.
Contributor
There was a problem hiding this comment.
That's true. Maybe we should skip this part of the change and only to the part in the paint function.
If the size is empty, then _updatePaintData will produce an invalid transform that yields a NaN canvas bounds rectangle Fixes flutter#7431
Member
Author
|
Removed the change to _updatePaintData and added a test |
faf45a5 to
f6c6268
Compare
Contributor
9 tasks
liyuqian
added a commit
to liyuqian/flutter
that referenced
this pull request
May 3, 2019
Update the test accordingly See flutter#7489 and flutter#7431 for the original purpose of the test.
liyuqian
added a commit
that referenced
this pull request
May 10, 2019
## Description These will help identify where the matrix starts to get wrong. Also fixed `RenderFittexBox` to no longer paint with empty child which previously triggered invalid matrix computations (NaN with dividing by 0). See also #7489 ## Related Issues #31650 #31700 #7431 ## Tests * RenderFittedBox does not paint with empty sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

If the size is empty, then _updatePaintData will produce an invalid transform
that yields a NaN canvas bounds rectangle
Fixes #7431