From b0d98934945e346867fab36d0463c8e282f06234 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 11 May 2018 15:18:35 -0700 Subject: [PATCH] Allow Canvas.saveLayer without bounds (flutter/engine#5240) Fixes https://github.com/flutter/flutter/issues/17497 --- engine/src/flutter/lib/ui/painting.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/painting.dart b/engine/src/flutter/lib/ui/painting.dart index 50b49647b1..f97b2d271b 100644 --- a/engine/src/flutter/lib/ui/painting.dart +++ b/engine/src/flutter/lib/ui/painting.dart @@ -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); }