From 9c5c511517100ddf2013f7983bab5eed97a8c315 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 24 Nov 2015 15:25:27 -0800 Subject: [PATCH] Opacity was dropping stuff on the floor. Turns out we passed the wrong bounds to the PaintingContext constructor. Fix, and assert that we don't do that again. --- packages/flutter/lib/src/rendering/object.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 01d540cda7..f7d8f95e62 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -59,7 +59,11 @@ typedef void PaintingContextCallback(PaintingContext context, Offset offset); /// not hold a reference to the canvas across operations that might paint /// child render objects. class PaintingContext { - PaintingContext._(this._containerLayer, this._paintBounds); + PaintingContext._(this._containerLayer, this._paintBounds) { + assert(_containerLayer != null); + assert(_paintBounds != null); + assert(!_paintBounds.isEmpty); + } final ContainerLayer _containerLayer; final Rect _paintBounds; @@ -304,7 +308,7 @@ class PaintingContext { _stopRecordingIfNeeded(); OpacityLayer opacityLayer = new OpacityLayer(bounds: bounds, alpha: alpha); _appendLayer(opacityLayer, offset); - PaintingContext childContext = new PaintingContext._(opacityLayer, bounds); + PaintingContext childContext = new PaintingContext._(opacityLayer, _paintBounds); painter(childContext, Offset.zero); childContext._stopRecordingIfNeeded(); } else {