-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Do not paint a RenderFittedBox with an empty size #7489
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
Do not paint a RenderFittedBox with an empty size #7489
Conversation
|
Test? |
|
You can build it with a custom painter inside and check that hte custom painter doesn't paint. |
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.
This doesn't seem right. Surely if the size is empty you're more likely to have overflow.
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.
In particular I suspect this will break localToGlobal for things inside a zero-size RenderFittedBox.
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.
We skip painting the child entirely, so there's no chance of visual overflow.
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.
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
|
Removed the change to _updatePaintData and added a test |
faf45a5 to
f6c6268
Compare
Update the test accordingly See flutter#7489 and flutter#7431 for the original purpose of the test.
## 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

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