Allow Canvas.saveLayer without bounds (flutter/engine#5240)

Fixes https://github.com/flutter/flutter/issues/17497
This commit is contained in:
Jason Simmons
2018-05-11 15:18:35 -07:00
committed by GitHub
parent 984b70e6ad
commit b0d9893494

View File

@@ -2680,11 +2680,11 @@ class Canvas extends NativeFieldWrapperClass2 {
/// * [BlendMode], which discusses the use of [Paint.blendMode] with
/// [saveLayer].
void saveLayer(Rect bounds, Paint paint) {
assert(_rectIsValid(bounds));
assert(paint != null);
if (bounds == null) {
_saveLayerWithoutBounds(paint._objects, paint._data);
} else {
assert(_rectIsValid(bounds));
_saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom,
paint._objects, paint._data);
}