Chromium Code Reviews| Index: sky/sdk/lib/framework/fn2.dart |
| diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart |
| index 2e3cd812ce5cd48bd34a21489309590435639dd2..9b114e94358c503c48ebaaa82a3d313fd269bb09 100644 |
| --- a/sky/sdk/lib/framework/fn2.dart |
| +++ b/sky/sdk/lib/framework/fn2.dart |
| @@ -408,10 +408,11 @@ class SizedBox extends OneChildRenderObjectWrapper { |
| final Size desiredSize; |
| SizedBox({ |
| - this.desiredSize: sky.Size.infinite, |
| + double width: double.INFINITY, |
| + double height: double.INFINITY, |
| UINode child, |
| Object key |
| - }) : super(child: child, key: key); |
| + }) : desiredSize = new Size(width, height), super(child: child, key: key); |
| RenderSizedBox createNode() => new RenderSizedBox(desiredSize: desiredSize); |
| @@ -955,14 +956,16 @@ class Container extends Component { |
| final EdgeDims margin; |
| final EdgeDims padding; |
| final Matrix4 transform; |
| - final Size desiredSize; |
| + final double width; |
| + final double height; |
| Container({ |
| Object key, |
| this.child, |
| this.constraints, |
| this.decoration, |
| - this.desiredSize, |
| + this.width, |
| + this.height, |
| this.margin, |
| this.padding, |
| this.transform |
| @@ -971,14 +974,21 @@ class Container extends Component { |
| UINode build() { |
| UINode current = child; |
| + if (child == null && width == null && height == null) |
| + current = new SizedBox(); |
| + |
| if (padding != null) |
| current = new Padding(padding: padding, child: current); |
| if (decoration != null) |
| current = new DecoratedBox(decoration: decoration, child: current); |
| - if (desiredSize != null) |
| - current = new SizedBox(desiredSize: desiredSize, child: current); |
| + if (width != null && height != null) |
| + current = new SizedBox(width: width, height: height, child: current); |
| + else if (width != null) |
| + current = new SizedBox(width: width, child: current); |
| + else if (height != null) |
| + current = new SizedBox(height: height, child: current); |
|
abarth-chromium
2015/06/08 21:09:01
if (width != null || height != null)
current = n
|
| if (constraints != null) |
| current = new ConstrainedBox(constraints: constraints); |
| @@ -989,9 +999,6 @@ class Container extends Component { |
| if (transform != null) |
| current = new Transform(transform: transform, child: current); |
| - if (current == null) |
| - current = new SizedBox(); |
| - |
| return current; |
| } |
| } |