diff --git a/engine/src/flutter/lib/web_ui/lib/geometry.dart b/engine/src/flutter/lib/web_ui/lib/geometry.dart index 2c01d61909f..6e366f08dc0 100644 --- a/engine/src/flutter/lib/web_ui/lib/geometry.dart +++ b/engine/src/flutter/lib/web_ui/lib/geometry.dart @@ -419,7 +419,6 @@ abstract class _RRectLike> { required this.brRadiusY, required this.blRadiusX, required this.blRadiusY, - required bool uniformRadii, }) : assert(tlRadiusX >= 0), assert(tlRadiusY >= 0), assert(trRadiusX >= 0), @@ -427,8 +426,7 @@ abstract class _RRectLike> { assert(brRadiusX >= 0), assert(brRadiusY >= 0), assert(blRadiusX >= 0), - assert(blRadiusY >= 0), - webOnlyUniformRadii = uniformRadii; + assert(blRadiusY >= 0); T _create({ required double left, @@ -460,8 +458,6 @@ abstract class _RRectLike> { Radius get brRadius => Radius.elliptical(brRadiusX, brRadiusY); final double blRadiusX; final double blRadiusY; - // webOnly - final bool webOnlyUniformRadii; Radius get blRadius => Radius.elliptical(blRadiusX, blRadiusY); T shift(Offset offset) { @@ -756,7 +752,6 @@ class RRect extends _RRectLike { blRadiusY: radiusY, brRadiusX: radiusX, brRadiusY: radiusY, - uniformRadii: radiusX == radiusY, ); RRect.fromLTRBR(double left, double top, double right, double bottom, Radius radius) @@ -773,7 +768,6 @@ class RRect extends _RRectLike { blRadiusY: radius.y, brRadiusX: radius.x, brRadiusY: radius.y, - uniformRadii: radius.x == radius.y, ); RRect.fromRectXY(Rect rect, double radiusX, double radiusY) @@ -790,7 +784,6 @@ class RRect extends _RRectLike { blRadiusY: radiusY, brRadiusX: radiusX, brRadiusY: radiusY, - uniformRadii: radiusX == radiusY, ); RRect.fromRectAndRadius(Rect rect, Radius radius) @@ -807,7 +800,6 @@ class RRect extends _RRectLike { blRadiusY: radius.y, brRadiusX: radius.x, brRadiusY: radius.y, - uniformRadii: radius.x == radius.y, ); RRect.fromLTRBAndCorners( @@ -832,14 +824,6 @@ class RRect extends _RRectLike { blRadiusY: bottomLeft.y, brRadiusX: bottomRight.x, brRadiusY: bottomRight.y, - uniformRadii: - topLeft.x == topLeft.y && - topLeft.x == topRight.x && - topLeft.x == topRight.y && - topLeft.x == bottomLeft.x && - topLeft.x == bottomLeft.y && - topLeft.x == bottomRight.x && - topLeft.x == bottomRight.y, ); RRect.fromRectAndCorners( @@ -861,14 +845,6 @@ class RRect extends _RRectLike { blRadiusY: bottomLeft.y, brRadiusX: bottomRight.x, brRadiusY: bottomRight.y, - uniformRadii: - topLeft.x == topLeft.y && - topLeft.x == topRight.x && - topLeft.x == topRight.y && - topLeft.x == bottomLeft.x && - topLeft.x == bottomLeft.y && - topLeft.x == bottomRight.x && - topLeft.x == bottomRight.y, ); const RRect._raw({ @@ -884,7 +860,6 @@ class RRect extends _RRectLike { super.brRadiusY = 0.0, super.blRadiusX = 0.0, super.blRadiusY = 0.0, - super.uniformRadii = false, }); @override @@ -1001,7 +976,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: radiusY, brRadiusX: radiusX, brRadiusY: radiusY, - uniformRadii: radiusX == radiusY, ); RSuperellipse.fromLTRBR(double left, double top, double right, double bottom, Radius radius) @@ -1018,7 +992,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: radius.y, brRadiusX: radius.x, brRadiusY: radius.y, - uniformRadii: radius.x == radius.y, ); RSuperellipse.fromRectXY(Rect rect, double radiusX, double radiusY) @@ -1035,7 +1008,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: radiusY, brRadiusX: radiusX, brRadiusY: radiusY, - uniformRadii: radiusX == radiusY, ); RSuperellipse.fromRectAndRadius(Rect rect, Radius radius) @@ -1052,7 +1024,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: radius.y, brRadiusX: radius.x, brRadiusY: radius.y, - uniformRadii: radius.x == radius.y, ); RSuperellipse.fromLTRBAndCorners( @@ -1077,14 +1048,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: bottomLeft.y, brRadiusX: bottomRight.x, brRadiusY: bottomRight.y, - uniformRadii: - topLeft.x == topLeft.y && - topLeft.x == topRight.x && - topLeft.x == topRight.y && - topLeft.x == bottomLeft.x && - topLeft.x == bottomLeft.y && - topLeft.x == bottomRight.x && - topLeft.x == bottomRight.y, ); RSuperellipse.fromRectAndCorners( @@ -1106,14 +1069,6 @@ class RSuperellipse extends _RRectLike { blRadiusY: bottomLeft.y, brRadiusX: bottomRight.x, brRadiusY: bottomRight.y, - uniformRadii: - topLeft.x == topLeft.y && - topLeft.x == topRight.x && - topLeft.x == topRight.y && - topLeft.x == bottomLeft.x && - topLeft.x == bottomLeft.y && - topLeft.x == bottomRight.x && - topLeft.x == bottomRight.y, ); const RSuperellipse._raw({ @@ -1129,7 +1084,6 @@ class RSuperellipse extends _RRectLike { super.brRadiusY = 0.0, super.blRadiusX = 0.0, super.blRadiusY = 0.0, - super.uniformRadii = false, }); @override diff --git a/engine/src/flutter/lib/web_ui/test/ui/rrect_test.dart b/engine/src/flutter/lib/web_ui/test/ui/rrect_test.dart index 172b4d3fa0d..b65fab106b8 100644 --- a/engine/src/flutter/lib/web_ui/test/ui/rrect_test.dart +++ b/engine/src/flutter/lib/web_ui/test/ui/rrect_test.dart @@ -49,87 +49,4 @@ Future testMain() async { expect(rrect.contains(const Offset(1.7, 1.97)), isTrue); expect(rrect.contains(const Offset(1.0, 1.99)), isTrue); }); - - test('RRect.webOnlyUniformRadii returns true when all corner radii are equal', () { - final RRect rect1 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect1.webOnlyUniformRadii, isTrue); - - final RRect rect2 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(1000, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect2.webOnlyUniformRadii, isFalse); - - final RRect rect3 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 1000), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect3.webOnlyUniformRadii, isFalse); - - final RRect rect4 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(1000, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect4.webOnlyUniformRadii, isFalse); - - final RRect rect5 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 1000), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect5.webOnlyUniformRadii, isFalse); - - final RRect rect6 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(1000, 5), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect6.webOnlyUniformRadii, isFalse); - - final RRect rect7 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 1000), - bottomRight: const Radius.elliptical(5, 5), - ); - expect(rect7.webOnlyUniformRadii, isFalse); - - final RRect rect8 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(1000, 5), - ); - expect(rect8.webOnlyUniformRadii, isFalse); - - final RRect rect9 = RRect.fromRectAndCorners( - const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0), - topLeft: const Radius.elliptical(5, 5), - topRight: const Radius.elliptical(5, 5), - bottomLeft: const Radius.elliptical(5, 5), - bottomRight: const Radius.elliptical(5, 1000), - ); - expect(rect9.webOnlyUniformRadii, isFalse); - }); }