Commit 4716b708 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #582 from Hixie/bad-opacity

Opacity was dropping stuff on the floor.
parents 83baf84e 9c5c5115
...@@ -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