Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1166203002: Rename Container's desiredSize argument to width and height arguments. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/components2/tool_bar.dart ('k') | sky/sdk/lib/framework/node.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « sky/sdk/lib/framework/components2/tool_bar.dart ('k') | sky/sdk/lib/framework/node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698