diff --git a/packages/flutter/lib/src/painting/box_border.dart b/packages/flutter/lib/src/painting/box_border.dart index ed6d815019b..650bd5d5d84 100644 --- a/packages/flutter/lib/src/painting/box_border.dart +++ b/packages/flutter/lib/src/painting/box_border.dart @@ -232,18 +232,7 @@ abstract class BoxBorder extends ShapeBorder { canvas.drawRRect(borderRadius.toRRect(rect), paint); } else { final RRect borderRect = borderRadius.toRRect(rect); - 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 inner = borderRect.deflate(side.strokeInset); final RRect outer = borderRect.inflate(side.strokeOutset); canvas.drawDRRect(outer, inner, paint); } diff --git a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart index c2ad93e2e01..2e2faf8daa2 100644 --- a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart @@ -132,18 +132,7 @@ class RoundedRectangleBorder extends OutlinedBorder { final Paint paint = Paint() ..color = side.color; final RRect borderRect = borderRadius.resolve(textDirection).toRRect(rect); - 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 inner = borderRect.deflate(side.strokeInset); final RRect outer = borderRect.inflate(side.strokeOutset); canvas.drawDRRect(outer, inner, paint); } diff --git a/packages/flutter/lib/src/rendering/table_border.dart b/packages/flutter/lib/src/rendering/table_border.dart index 5b22555317b..d504bf4a35a 100644 --- a/packages/flutter/lib/src/rendering/table_border.dart +++ b/packages/flutter/lib/src/rendering/table_border.dart @@ -271,18 +271,7 @@ class TableBorder { paintBorder(canvas, rect, top: top, right: right, bottom: bottom, left: left); } else { final RRect outer = borderRadius.toRRect(rect); - 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 RRect inner = outer.deflate(top.width); final Paint paint = Paint()..color = top.color; canvas.drawDRRect(outer, inner, paint); } diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index b439dcd987d..7734bd273ca 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -129,17 +129,6 @@ class _MulticastCanvas implements Canvas { @override 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); _screenshot.drawDRRect(outer, inner, paint); }