Unverified Commit 1160c8fd authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Re-Staged: Fixing ContinuousRectangleBorder bottom radius (#45304)

parent c64d91a0
...@@ -115,10 +115,10 @@ class ContinuousRectangleBorder extends ShapeBorder { ...@@ -115,10 +115,10 @@ class ContinuousRectangleBorder extends ShapeBorder {
..cubicTo(left, top, left, top, left + tlRadiusY, top) ..cubicTo(left, top, left, top, left + tlRadiusY, top)
..lineTo(right - trRadiusX, top) ..lineTo(right - trRadiusX, top)
..cubicTo(right, top, right, top, right, top + trRadiusY) ..cubicTo(right, top, right, top, right, top + trRadiusY)
..lineTo(right, bottom - blRadiusX) ..lineTo(right, bottom - brRadiusX)
..cubicTo(right, bottom, right, bottom, right - blRadiusY, bottom) ..cubicTo(right, bottom, right, bottom, right - brRadiusY, bottom)
..lineTo(left + brRadiusX, bottom) ..lineTo(left + blRadiusX, bottom)
..cubicTo(left, bottom, left, bottom, left, bottom - brRadiusY) ..cubicTo(left, bottom, left, bottom, left, bottom - blRadiusY)
..close(); ..close();
} }
......
...@@ -78,11 +78,13 @@ void main() { ...@@ -78,11 +78,13 @@ void main() {
testWidgets('Golden test varying radii', (WidgetTester tester) async { testWidgets('Golden test varying radii', (WidgetTester tester) async {
await tester.pumpWidget(RepaintBoundary( await tester.pumpWidget(RepaintBoundary(
child: Material( child: Material(
color: Colors.greenAccent[400], color: Colors.green[100],
shape: const ContinuousRectangleBorder( shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(28.0), topLeft: Radius.elliptical(100.0, 200.0),
bottomRight: Radius.circular(14.0), topRight: Radius.circular(350.0),
bottomLeft: Radius.elliptical(2000.0, 100.0),
bottomRight: Radius.circular(700.0),
), ),
), ),
), ),
...@@ -94,6 +96,91 @@ void main() { ...@@ -94,6 +96,91 @@ void main() {
find.byType(RepaintBoundary), find.byType(RepaintBoundary),
matchesGoldenFile('continuous_rectangle_border.golden_test_varying_radii.png'), matchesGoldenFile('continuous_rectangle_border.golden_test_varying_radii.png'),
); );
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
}, skip: isBrowser);
testWidgets('Golden test topLeft radii', (WidgetTester tester) async {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.green[200],
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.elliptical(100.0, 200.0),
),
),
),
));
await tester.pumpAndSettle();
await expectLater(
find.byType(RepaintBoundary),
matchesGoldenFile('continuous_rectangle_border.golden_test_topLeft_radii.png'),
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
}, skip: isBrowser);
testWidgets('Golden test topRight radii', (WidgetTester tester) async {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.green[300],
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(350.0),
),
),
),
));
await tester.pumpAndSettle();
await expectLater(
find.byType(RepaintBoundary),
matchesGoldenFile('continuous_rectangle_border.golden_test_topRight_radii.png'),
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
}, skip: isBrowser);
testWidgets('Golden test bottomLeft radii', (WidgetTester tester) async {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.green[400],
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.elliptical(2000.0, 100.0),
),
),
),
));
await tester.pumpAndSettle();
await expectLater(
find.byType(RepaintBoundary),
matchesGoldenFile('continuous_rectangle_border.golden_test_bottomLeft_radii.png'),
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
}, skip: isBrowser);
testWidgets('Golden test bottomRight radii', (WidgetTester tester) async {
await tester.pumpWidget(RepaintBoundary(
child: Material(
color: Colors.green[500],
shape: const ContinuousRectangleBorder(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(700.0),
),
),
),
));
await tester.pumpAndSettle();
await expectLater(
find.byType(RepaintBoundary),
matchesGoldenFile('continuous_rectangle_border.golden_test_bottomRight_radii.png'),
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
}, skip: isBrowser); }, skip: isBrowser);
testWidgets('Golden test large radii', (WidgetTester tester) async { testWidgets('Golden test large radii', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment