-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Fix painting material toggle (#78733) #78744
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
Fix painting material toggle (#78733) #78744
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
5573096
to
359028c
Compare
const double radiusAdditionalOffset = _kTrackRadius / 2; | ||
final double parentWidthOffset = size.width / 2 - trackWidth + radiusAdditionalOffset; |
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 am not fully following along how the parentWidthOffset has been determined, can you explain that?
I thought it would just be (size.width - _kSwitchWidth) / 2.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.
I've refactored the implementation a bit to make it easier to follow, hope that helps
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 makes it .. more confusing to follow along. I think the previous implementation was easier to understand. Can you just give a verbal explanation of why the parentWidthOffset
has to be size.width / 2 - trackWidth + radiusAdditionalOffset
over just (size.width - _kSwitchWidth) / 2.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.
do you mind pointing out what's more confusing?
Also, while refactoring I've found that my previous implementation was wrong as I was confused due to the amount of informations. I read the material design switch spec which made things clearer and so I believe the current solution to be correct.
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.
@goderbauer perhaps I could add some comments? I think it's really hard to assign meaningful names to the variables I'm modifying, 1-2 comment lines per logic block would probably explain a lot
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.
Some comments would probably help.
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.
@goderbauer do you mind having a look? I hope it's better now
359028c
to
d97734d
Compare
Gold has detected about 2 untriaged digest(s) on patchset 1. |
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #78744 at sha d97734ddc53a0e82227da07914be5b5ed7063abf |
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
d97734d
to
2c85354
Compare
(triage) Hi @eEQK, it looks like this PR has not been updated in a while, and several test are failing. Do you plan to return to this change? |
I didn't receive any response since my last commit, so I just assumed someone has yet to look at the updated PR. I believe the tests were failing on all PRs at the time, although I'm not sure why goldens are still pending. I'll sync my code with master and let's see whether they're fixed. |
2c85354
to
f953b98
Compare
Gold has detected about 27 new digest(s) on patchset 1. |
f953b98
to
058350c
Compare
Gold has detected about 2 new digest(s) on patchset 1. |
Gold has detected about 29 new digest(s) on patchset 1. |
Gold has detected about 2 new digest(s) on patchset 1. |
FYI @kjlubick, can you confirm if the skia bot is confused here? |
@Piinks looks like it's working now 🎉 |
Thank you for the updates! I need to confirm the golden file changes before this moves forward. It looks like there may be a bug there (not on your end), this should not be all green since you are adding new golden images. I'll see what's going on there and circe back here. Thanks for your patience! |
Something certainly appears confused on my end @Piinks; I'll look into it. |
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.
LGTM! Golden files are all good. Thanks for your patience! Can you update your branch again? It looks like there is a merge conflict.
058350c
to
b7fa723
Compare
Amazing, thanks. I've resolved the conflict |
This PR fixes painting material toggle, as it was a bit weird.
Fixes #78733
This is how it looks like on stable branch: https://www.dartpad.dev/ec2251e3d3f653f144cf5ac20a0c9a55?null_safety=true
Current master:


With my changes:


Pre-launch Checklist
///
).