[path_parsing] Fix deprecation lints - #12704
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. 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. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
I would think this is a situation where we cannot write tests and the existing ones are used to catch regressions? Also, I updated the entry What do you think? |
There was a problem hiding this comment.
Code Review
This pull request updates the path_parsing package to address deprecation lints by replacing deprecated scale calls with scaledByDouble in SvgPathNormalizer. The review feedback suggests simplifying the scaledByDouble calls by passing 1.0 for both the Z and W scale factors, as these components are unused in 2D mapping.
| pointTransform.setIdentity(); | ||
|
|
||
| pointTransform.scale(1.0 / rx, 1.0 / ry); | ||
| pointTransform.scaledByDouble(1.0 / rx, 1.0 / ry, 1.0 / rx, 1); |
There was a problem hiding this comment.
Since this is a 2D transformation and the Z/W components are completely unused by _mapPoint, we can pass 1.0 for both the Z and W scale factors instead of 1.0 / rx and 1. This is cleaner, more explicit, and avoids unnecessary calculations.
| pointTransform.scaledByDouble(1.0 / rx, 1.0 / ry, 1.0 / rx, 1); | |
| pointTransform.scaledByDouble(1.0 / rx, 1.0 / ry, 1.0, 1.0); |
| pointTransform.setIdentity(); | ||
| pointTransform.rotateZ(angle); | ||
| pointTransform.scale(rx, ry); | ||
| pointTransform.scaledByDouble(rx, ry, rx, 1); |
aa1d8e2 to
a28acb6
Compare
Part of flutter/flutter#178120
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2