Make Layer.toImage() accept bounds rather than size (#17129)

It allows callers to account for things like shadows that paint
outside the bounds of the widget.

https://github.com/flutter/flutter/issues/16859
This commit is contained in:
Todd Volkert
2018-04-30 15:26:17 -07:00
committed by GitHub
parent 5972fdb7aa
commit b2c67e88d4
4 changed files with 32 additions and 9 deletions

View File

@@ -1235,7 +1235,7 @@ class _MatchesGoldenFile extends AsyncMatcher {
}
assert(!renderObject.debugNeedsPaint);
final OffsetLayer layer = renderObject.layer;
final Future<ui.Image> imageFuture = layer.toImage(element.size);
final Future<ui.Image> imageFuture = layer.toImage(renderObject.paintBounds);
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
return binding.runAsync<String>(() async {