Allow Canvas.saveLayer without bounds (flutter/engine#5240)
Fixes https://github.com/flutter/flutter/issues/17497
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user