Skip to content

Commit aef4718

Browse files
authored
[Web] Remove webOnlyUniformRadii from RRect (flutter#167237)
This variable was added in flutter/engine#15970 (for the HTML renderer I guess?) and is apparently no long used anywhere. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 055b23d commit aef4718

File tree

2 files changed

+1
-130
lines changed

2 files changed

+1
-130
lines changed

engine/src/flutter/lib/web_ui/lib/geometry.dart

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,14 @@ abstract class _RRectLike<T extends _RRectLike<T>> {
419419
required this.brRadiusY,
420420
required this.blRadiusX,
421421
required this.blRadiusY,
422-
required bool uniformRadii,
423422
}) : assert(tlRadiusX >= 0),
424423
assert(tlRadiusY >= 0),
425424
assert(trRadiusX >= 0),
426425
assert(trRadiusY >= 0),
427426
assert(brRadiusX >= 0),
428427
assert(brRadiusY >= 0),
429428
assert(blRadiusX >= 0),
430-
assert(blRadiusY >= 0),
431-
webOnlyUniformRadii = uniformRadii;
429+
assert(blRadiusY >= 0);
432430

433431
T _create({
434432
required double left,
@@ -460,8 +458,6 @@ abstract class _RRectLike<T extends _RRectLike<T>> {
460458
Radius get brRadius => Radius.elliptical(brRadiusX, brRadiusY);
461459
final double blRadiusX;
462460
final double blRadiusY;
463-
// webOnly
464-
final bool webOnlyUniformRadii;
465461
Radius get blRadius => Radius.elliptical(blRadiusX, blRadiusY);
466462

467463
T shift(Offset offset) {
@@ -756,7 +752,6 @@ class RRect extends _RRectLike<RRect> {
756752
blRadiusY: radiusY,
757753
brRadiusX: radiusX,
758754
brRadiusY: radiusY,
759-
uniformRadii: radiusX == radiusY,
760755
);
761756

762757
RRect.fromLTRBR(double left, double top, double right, double bottom, Radius radius)
@@ -773,7 +768,6 @@ class RRect extends _RRectLike<RRect> {
773768
blRadiusY: radius.y,
774769
brRadiusX: radius.x,
775770
brRadiusY: radius.y,
776-
uniformRadii: radius.x == radius.y,
777771
);
778772

779773
RRect.fromRectXY(Rect rect, double radiusX, double radiusY)
@@ -790,7 +784,6 @@ class RRect extends _RRectLike<RRect> {
790784
blRadiusY: radiusY,
791785
brRadiusX: radiusX,
792786
brRadiusY: radiusY,
793-
uniformRadii: radiusX == radiusY,
794787
);
795788

796789
RRect.fromRectAndRadius(Rect rect, Radius radius)
@@ -807,7 +800,6 @@ class RRect extends _RRectLike<RRect> {
807800
blRadiusY: radius.y,
808801
brRadiusX: radius.x,
809802
brRadiusY: radius.y,
810-
uniformRadii: radius.x == radius.y,
811803
);
812804

813805
RRect.fromLTRBAndCorners(
@@ -832,14 +824,6 @@ class RRect extends _RRectLike<RRect> {
832824
blRadiusY: bottomLeft.y,
833825
brRadiusX: bottomRight.x,
834826
brRadiusY: bottomRight.y,
835-
uniformRadii:
836-
topLeft.x == topLeft.y &&
837-
topLeft.x == topRight.x &&
838-
topLeft.x == topRight.y &&
839-
topLeft.x == bottomLeft.x &&
840-
topLeft.x == bottomLeft.y &&
841-
topLeft.x == bottomRight.x &&
842-
topLeft.x == bottomRight.y,
843827
);
844828

845829
RRect.fromRectAndCorners(
@@ -861,14 +845,6 @@ class RRect extends _RRectLike<RRect> {
861845
blRadiusY: bottomLeft.y,
862846
brRadiusX: bottomRight.x,
863847
brRadiusY: bottomRight.y,
864-
uniformRadii:
865-
topLeft.x == topLeft.y &&
866-
topLeft.x == topRight.x &&
867-
topLeft.x == topRight.y &&
868-
topLeft.x == bottomLeft.x &&
869-
topLeft.x == bottomLeft.y &&
870-
topLeft.x == bottomRight.x &&
871-
topLeft.x == bottomRight.y,
872848
);
873849

874850
const RRect._raw({
@@ -884,7 +860,6 @@ class RRect extends _RRectLike<RRect> {
884860
super.brRadiusY = 0.0,
885861
super.blRadiusX = 0.0,
886862
super.blRadiusY = 0.0,
887-
super.uniformRadii = false,
888863
});
889864

890865
@override
@@ -1001,7 +976,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
1001976
blRadiusY: radiusY,
1002977
brRadiusX: radiusX,
1003978
brRadiusY: radiusY,
1004-
uniformRadii: radiusX == radiusY,
1005979
);
1006980

1007981
RSuperellipse.fromLTRBR(double left, double top, double right, double bottom, Radius radius)
@@ -1018,7 +992,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
1018992
blRadiusY: radius.y,
1019993
brRadiusX: radius.x,
1020994
brRadiusY: radius.y,
1021-
uniformRadii: radius.x == radius.y,
1022995
);
1023996

1024997
RSuperellipse.fromRectXY(Rect rect, double radiusX, double radiusY)
@@ -1035,7 +1008,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
10351008
blRadiusY: radiusY,
10361009
brRadiusX: radiusX,
10371010
brRadiusY: radiusY,
1038-
uniformRadii: radiusX == radiusY,
10391011
);
10401012

10411013
RSuperellipse.fromRectAndRadius(Rect rect, Radius radius)
@@ -1052,7 +1024,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
10521024
blRadiusY: radius.y,
10531025
brRadiusX: radius.x,
10541026
brRadiusY: radius.y,
1055-
uniformRadii: radius.x == radius.y,
10561027
);
10571028

10581029
RSuperellipse.fromLTRBAndCorners(
@@ -1077,14 +1048,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
10771048
blRadiusY: bottomLeft.y,
10781049
brRadiusX: bottomRight.x,
10791050
brRadiusY: bottomRight.y,
1080-
uniformRadii:
1081-
topLeft.x == topLeft.y &&
1082-
topLeft.x == topRight.x &&
1083-
topLeft.x == topRight.y &&
1084-
topLeft.x == bottomLeft.x &&
1085-
topLeft.x == bottomLeft.y &&
1086-
topLeft.x == bottomRight.x &&
1087-
topLeft.x == bottomRight.y,
10881051
);
10891052

10901053
RSuperellipse.fromRectAndCorners(
@@ -1106,14 +1069,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
11061069
blRadiusY: bottomLeft.y,
11071070
brRadiusX: bottomRight.x,
11081071
brRadiusY: bottomRight.y,
1109-
uniformRadii:
1110-
topLeft.x == topLeft.y &&
1111-
topLeft.x == topRight.x &&
1112-
topLeft.x == topRight.y &&
1113-
topLeft.x == bottomLeft.x &&
1114-
topLeft.x == bottomLeft.y &&
1115-
topLeft.x == bottomRight.x &&
1116-
topLeft.x == bottomRight.y,
11171072
);
11181073

11191074
const RSuperellipse._raw({
@@ -1129,7 +1084,6 @@ class RSuperellipse extends _RRectLike<RSuperellipse> {
11291084
super.brRadiusY = 0.0,
11301085
super.blRadiusX = 0.0,
11311086
super.blRadiusY = 0.0,
1132-
super.uniformRadii = false,
11331087
});
11341088

11351089
@override

engine/src/flutter/lib/web_ui/test/ui/rrect_test.dart

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -49,87 +49,4 @@ Future<void> testMain() async {
4949
expect(rrect.contains(const Offset(1.7, 1.97)), isTrue);
5050
expect(rrect.contains(const Offset(1.0, 1.99)), isTrue);
5151
});
52-
53-
test('RRect.webOnlyUniformRadii returns true when all corner radii are equal', () {
54-
final RRect rect1 = RRect.fromRectAndCorners(
55-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
56-
topLeft: const Radius.elliptical(5, 5),
57-
topRight: const Radius.elliptical(5, 5),
58-
bottomLeft: const Radius.elliptical(5, 5),
59-
bottomRight: const Radius.elliptical(5, 5),
60-
);
61-
expect(rect1.webOnlyUniformRadii, isTrue);
62-
63-
final RRect rect2 = RRect.fromRectAndCorners(
64-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
65-
topLeft: const Radius.elliptical(1000, 5),
66-
topRight: const Radius.elliptical(5, 5),
67-
bottomLeft: const Radius.elliptical(5, 5),
68-
bottomRight: const Radius.elliptical(5, 5),
69-
);
70-
expect(rect2.webOnlyUniformRadii, isFalse);
71-
72-
final RRect rect3 = RRect.fromRectAndCorners(
73-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
74-
topLeft: const Radius.elliptical(5, 1000),
75-
topRight: const Radius.elliptical(5, 5),
76-
bottomLeft: const Radius.elliptical(5, 5),
77-
bottomRight: const Radius.elliptical(5, 5),
78-
);
79-
expect(rect3.webOnlyUniformRadii, isFalse);
80-
81-
final RRect rect4 = RRect.fromRectAndCorners(
82-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
83-
topLeft: const Radius.elliptical(5, 5),
84-
topRight: const Radius.elliptical(1000, 5),
85-
bottomLeft: const Radius.elliptical(5, 5),
86-
bottomRight: const Radius.elliptical(5, 5),
87-
);
88-
expect(rect4.webOnlyUniformRadii, isFalse);
89-
90-
final RRect rect5 = RRect.fromRectAndCorners(
91-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
92-
topLeft: const Radius.elliptical(5, 5),
93-
topRight: const Radius.elliptical(5, 1000),
94-
bottomLeft: const Radius.elliptical(5, 5),
95-
bottomRight: const Radius.elliptical(5, 5),
96-
);
97-
expect(rect5.webOnlyUniformRadii, isFalse);
98-
99-
final RRect rect6 = RRect.fromRectAndCorners(
100-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
101-
topLeft: const Radius.elliptical(5, 5),
102-
topRight: const Radius.elliptical(5, 5),
103-
bottomLeft: const Radius.elliptical(1000, 5),
104-
bottomRight: const Radius.elliptical(5, 5),
105-
);
106-
expect(rect6.webOnlyUniformRadii, isFalse);
107-
108-
final RRect rect7 = RRect.fromRectAndCorners(
109-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
110-
topLeft: const Radius.elliptical(5, 5),
111-
topRight: const Radius.elliptical(5, 5),
112-
bottomLeft: const Radius.elliptical(5, 1000),
113-
bottomRight: const Radius.elliptical(5, 5),
114-
);
115-
expect(rect7.webOnlyUniformRadii, isFalse);
116-
117-
final RRect rect8 = RRect.fromRectAndCorners(
118-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
119-
topLeft: const Radius.elliptical(5, 5),
120-
topRight: const Radius.elliptical(5, 5),
121-
bottomLeft: const Radius.elliptical(5, 5),
122-
bottomRight: const Radius.elliptical(1000, 5),
123-
);
124-
expect(rect8.webOnlyUniformRadii, isFalse);
125-
126-
final RRect rect9 = RRect.fromRectAndCorners(
127-
const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
128-
topLeft: const Radius.elliptical(5, 5),
129-
topRight: const Radius.elliptical(5, 5),
130-
bottomLeft: const Radius.elliptical(5, 5),
131-
bottomRight: const Radius.elliptical(5, 1000),
132-
);
133-
expect(rect9.webOnlyUniformRadii, isFalse);
134-
});
13552
}

0 commit comments

Comments
 (0)