Prepare the framework for having RRect assert on negative radii#111515
Prepare the framework for having RRect assert on negative radii#111515auto-submit[bot] merged 4 commits intoflutter:masterfrom
Conversation
db04f9b to
4629129
Compare
cad7592 to
93b2ba0
Compare
93b2ba0 to
5cff932
Compare
| topRight: topRight, | ||
| bottomLeft: bottomLeft, | ||
| bottomRight: bottomRight, | ||
| topLeft: topLeft.clamp(minimum: Radius.zero), // ignore_clamp_double_lint |
There was a problem hiding this comment.
Maybe create a RRect.clampCorners method? that applies one minimum/maximum radius to all four corners?
There was a problem hiding this comment.
Sure, I could, but really this won't be a problem once the RRect doesn't allow negative values anymore (which will happen shortly). I mean, sure, clamping to something other that zero might also be important, but it's not something that people have requested.
EDIT: Actually, these will remain in place. Can I maybe wait to add RRect.clampCorners? If it's not required, I won't need to make a round trip through the engine in order to land this PR.
| topLeft: topLeft.clamp(minimum: Radius.zero), // ignore_clamp_double_lint | ||
| topRight: topRight.clamp(minimum: Radius.zero), // ignore_clamp_double_lint | ||
| bottomLeft: bottomLeft.clamp(minimum: Radius.zero), // ignore_clamp_double_lint | ||
| bottomRight: bottomRight.clamp(minimum: Radius.zero), // ignore_clamp_double_lint |
There was a problem hiding this comment.
Are these ignores temporary? If so, maybe add a TODO?
There was a problem hiding this comment.
Also, why are these ignores needed in the first place? You aren't even calling clamp on double here.
Is the ignore_clamp_double_lint triggering too broadly and needs some tightening?
There was a problem hiding this comment.
Yes, I wondered the same thing, but there are reasons why we can't narrow it.
See here.
goderbauer
left a comment
There was a problem hiding this comment.
LGTM with added doc comment
* update engine version * Prepare the framework for having RRect assert on negative radii (#111515) * Remove no-longer-needed clamping of RRect radii (#111668) Co-authored-by: Greg Spencer <[email protected]>
* update engine version * Prepare the framework for having RRect assert on negative radii (#111515) * Remove no-longer-needed clamping of RRect radii (#111668) * Revert "Use semantics label for backbutton and closebutton for Androi… (#111636) * Roll Flutter Engine from 4096e13 to 6610f3f (11 revisions) (#111240) * Revert Ballistic & Clamping simulation updates (#111201) * Revert "Update `MaterialBanner` to support Material 3" (#111288) * Revert "Use semantics label for backbutton and closebutton for Android" (#111305) Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Casey Hillers <[email protected]> Co-authored-by: Xilai Zhang <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: godofredoc <[email protected]> Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Casey Hillers <[email protected]> Co-authored-by: Xilai Zhang <[email protected]>
Description
This prepares the framework for flutter/engine#36062 to roll into the framework, which will clamp rounded rect (
RRect) corner radii to a min of zero when deflating, and assert that radii are not negative.In order for that to roll in cleanly, we need to change the framework so that it does its own clamping when deflating rounded rects. Once the engine change rolls in, we can remove the extra clamping.
Related Issues
Tests