Commit 9c5c5115 authored by Hixie's avatar Hixie

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.
parent 83baf84e
...@@ -59,7 +59,11 @@ typedef void PaintingContextCallback(PaintingContext context, Offset offset); ...@@ -59,7 +59,11 @@ typedef void PaintingContextCallback(PaintingContext context, Offset offset);
/// not hold a reference to the canvas across operations that might paint /// not hold a reference to the canvas across operations that might paint
/// child render objects. /// child render objects.
class PaintingContext { 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 ContainerLayer _containerLayer;
final Rect _paintBounds; final Rect _paintBounds;
...@@ -304,7 +308,7 @@ class PaintingContext { ...@@ -304,7 +308,7 @@ class PaintingContext {
_stopRecordingIfNeeded(); _stopRecordingIfNeeded();
OpacityLayer opacityLayer = new OpacityLayer(bounds: bounds, alpha: alpha); OpacityLayer opacityLayer = new OpacityLayer(bounds: bounds, alpha: alpha);
_appendLayer(opacityLayer, offset); _appendLayer(opacityLayer, offset);
PaintingContext childContext = new PaintingContext._(opacityLayer, bounds); PaintingContext childContext = new PaintingContext._(opacityLayer, _paintBounds);
painter(childContext, Offset.zero); painter(childContext, Offset.zero);
childContext._stopRecordingIfNeeded(); childContext._stopRecordingIfNeeded();
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment