Remove no-longer-needed clamping of RRect radii (#111668)
This commit is contained in:
@@ -232,18 +232,7 @@ abstract class BoxBorder extends ShapeBorder {
|
|||||||
canvas.drawRRect(borderRadius.toRRect(rect), paint);
|
canvas.drawRRect(borderRadius.toRRect(rect), paint);
|
||||||
} else {
|
} else {
|
||||||
final RRect borderRect = borderRadius.toRRect(rect);
|
final RRect borderRect = borderRadius.toRRect(rect);
|
||||||
RRect inner = borderRect.deflate(side.strokeInset);
|
final RRect inner = borderRect.deflate(side.strokeInset);
|
||||||
// Clamp the inner border's radii to zero, until deflate does this
|
|
||||||
// automatically, so that we can start asserting non-negative values
|
|
||||||
// in the engine without breaking the framework.
|
|
||||||
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
|
|
||||||
inner = RRect.fromLTRBAndCorners(
|
|
||||||
inner.left, inner.top, inner.right, inner.bottom,
|
|
||||||
topLeft: inner.tlRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
topRight: inner.trRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomLeft: inner.blRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomRight: inner.brRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
);
|
|
||||||
final RRect outer = borderRect.inflate(side.strokeOutset);
|
final RRect outer = borderRect.inflate(side.strokeOutset);
|
||||||
canvas.drawDRRect(outer, inner, paint);
|
canvas.drawDRRect(outer, inner, paint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,18 +132,7 @@ class RoundedRectangleBorder extends OutlinedBorder {
|
|||||||
final Paint paint = Paint()
|
final Paint paint = Paint()
|
||||||
..color = side.color;
|
..color = side.color;
|
||||||
final RRect borderRect = borderRadius.resolve(textDirection).toRRect(rect);
|
final RRect borderRect = borderRadius.resolve(textDirection).toRRect(rect);
|
||||||
RRect inner = borderRect.deflate(side.strokeInset);
|
final RRect inner = borderRect.deflate(side.strokeInset);
|
||||||
// Clamp the inner border's radii to zero, until deflate does this
|
|
||||||
// automatically, so that we can start asserting non-negative values
|
|
||||||
// in the engine without breaking the framework.
|
|
||||||
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
|
|
||||||
inner = RRect.fromLTRBAndCorners(
|
|
||||||
inner.left, inner.top, inner.right, inner.bottom,
|
|
||||||
topLeft: inner.tlRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
topRight: inner.trRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomLeft: inner.blRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomRight: inner.brRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
);
|
|
||||||
final RRect outer = borderRect.inflate(side.strokeOutset);
|
final RRect outer = borderRect.inflate(side.strokeOutset);
|
||||||
canvas.drawDRRect(outer, inner, paint);
|
canvas.drawDRRect(outer, inner, paint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,18 +271,7 @@ class TableBorder {
|
|||||||
paintBorder(canvas, rect, top: top, right: right, bottom: bottom, left: left);
|
paintBorder(canvas, rect, top: top, right: right, bottom: bottom, left: left);
|
||||||
} else {
|
} else {
|
||||||
final RRect outer = borderRadius.toRRect(rect);
|
final RRect outer = borderRadius.toRRect(rect);
|
||||||
RRect inner = outer.deflate(top.width);
|
final RRect inner = outer.deflate(top.width);
|
||||||
// Clamp the inner border's radii to zero, until deflate does this
|
|
||||||
// automatically, so that we can start asserting non-negative values
|
|
||||||
// in the engine without breaking the framework.
|
|
||||||
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
|
|
||||||
inner = RRect.fromLTRBAndCorners(
|
|
||||||
inner.left, inner.top, inner.right, inner.bottom,
|
|
||||||
topLeft: inner.tlRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
topRight: inner.trRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomLeft: inner.blRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomRight: inner.brRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
);
|
|
||||||
final Paint paint = Paint()..color = top.color;
|
final Paint paint = Paint()..color = top.color;
|
||||||
canvas.drawDRRect(outer, inner, paint);
|
canvas.drawDRRect(outer, inner, paint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,17 +129,6 @@ class _MulticastCanvas implements Canvas {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void drawDRRect(RRect outer, RRect inner, Paint paint) {
|
void drawDRRect(RRect outer, RRect inner, Paint paint) {
|
||||||
// Clamp the inner border's radii to zero, until deflate does this
|
|
||||||
// automatically, so that we can start asserting non-negative values
|
|
||||||
// in the engine without breaking the framework.
|
|
||||||
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
|
|
||||||
inner = RRect.fromLTRBAndCorners(
|
|
||||||
inner.left, inner.top, inner.right, inner.bottom,
|
|
||||||
topLeft: inner.tlRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
topRight: inner.trRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomLeft: inner.blRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
bottomRight: inner.brRadius.clamp(minimum: Radius.zero), // ignore_clamp_double_lint
|
|
||||||
);
|
|
||||||
_main.drawDRRect(outer, inner, paint);
|
_main.drawDRRect(outer, inner, paint);
|
||||||
_screenshot.drawDRRect(outer, inner, paint);
|
_screenshot.drawDRRect(outer, inner, paint);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user