Revert "Fix outline button solid path when BorderSize.width is used (#51581)" (#60000)

This reverts commit 599566177736e6b30af922a8f06e8a260acafc36.
This commit is contained in:
Jonah Williams 2020-06-22 10:13:37 -07:00 committed by GitHub
parent 5995661777
commit 04ce9d288c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 38 deletions

View File

@ -561,7 +561,7 @@ class _OutlineBorder extends ShapeBorder implements MaterialStateProperty<ShapeB
case BorderStyle.none:
break;
case BorderStyle.solid:
canvas.drawPath(shape.getOuterPath(rect.deflate(side.width / 2.0), textDirection: textDirection), side.toPaint());
canvas.drawPath(shape.getOuterPath(rect, textDirection: textDirection), side.toPaint());
}
}

View File

@ -867,39 +867,6 @@ void main() {
);
});
testWidgets('OutlineButton uses borderSide width to paint', (WidgetTester tester) async {
final GlobalKey buttonKey = GlobalKey();
const double thickness = 12.5;
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: Align(
alignment: Alignment.topLeft,
child: OutlineButton(
key: buttonKey,
borderSide: const BorderSide(
color: Colors.black12,
width: thickness),
onPressed: () {},
child: const SizedBox(
width: 120,
height: 50,
child: Text('ABC'),
),
),
),
),
),
);
final Finder outlineButton = find.byType(OutlineButton);
expect(outlineButton, paints..path(
includes: const <Offset>[Offset(60, thickness / 2.0)],
excludes: const <Offset>[Offset(60, thickness / 3.0)],
));
});
testWidgets('OutlineButton contributes semantics', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(

View File

@ -1163,15 +1163,13 @@ class _PathPaintPredicate extends _DrawCommandPaintPredicate {
if (includes != null) {
for (final Offset offset in includes) {
if (!pathArgument.contains(offset))
throw 'It called $methodName with a path that unexpectedly did not '
'contain $offset. Path bounds = ${pathArgument.getBounds()}';
throw 'It called $methodName with a path that unexpectedly did not contain $offset.';
}
}
if (excludes != null) {
for (final Offset offset in excludes) {
if (pathArgument.contains(offset))
throw 'It called $methodName with a path that unexpectedly '
'contained $offset. . Path bounds = ${pathArgument.getBounds()}';
throw 'It called $methodName with a path that unexpectedly contained $offset.';
}
}
}