mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
Re-Staged: Fixing ContinuousRectangleBorder bottom radius (#45304)
This commit is contained in:
parent
c64d91a03f
commit
1160c8fd29
|
@ -115,10 +115,10 @@ class ContinuousRectangleBorder extends ShapeBorder {
|
|||
..cubicTo(left, top, left, top, left + tlRadiusY, top)
|
||||
..lineTo(right - trRadiusX, top)
|
||||
..cubicTo(right, top, right, top, right, top + trRadiusY)
|
||||
..lineTo(right, bottom - blRadiusX)
|
||||
..cubicTo(right, bottom, right, bottom, right - blRadiusY, bottom)
|
||||
..lineTo(left + brRadiusX, bottom)
|
||||
..cubicTo(left, bottom, left, bottom, left, bottom - brRadiusY)
|
||||
..lineTo(right, bottom - brRadiusX)
|
||||
..cubicTo(right, bottom, right, bottom, right - brRadiusY, bottom)
|
||||
..lineTo(left + blRadiusX, bottom)
|
||||
..cubicTo(left, bottom, left, bottom, left, bottom - blRadiusY)
|
||||
..close();
|
||||
}
|
||||
|
||||
|
|
|
@ -78,11 +78,13 @@ void main() {
|
|||
testWidgets('Golden test varying radii', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(RepaintBoundary(
|
||||
child: Material(
|
||||
color: Colors.greenAccent[400],
|
||||
color: Colors.green[100],
|
||||
shape: const ContinuousRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(28.0),
|
||||
bottomRight: Radius.circular(14.0),
|
||||
topLeft: Radius.elliptical(100.0, 200.0),
|
||||
topRight: Radius.circular(350.0),
|
||||
bottomLeft: Radius.elliptical(2000.0, 100.0),
|
||||
bottomRight: Radius.circular(700.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -94,6 +96,91 @@ void main() {
|
|||
find.byType(RepaintBoundary),
|
||||
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);
|
||||
|
||||
testWidgets('Golden test large radii', (WidgetTester tester) async {
|
||||
|
|
Loading…
Reference in a new issue