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 a83535857bbe69f40d63e7c73b6169cb15a69855..7d9d5afe4708c6b686ba4f8c284df5ec3dee32a6 100644 |
| --- a/sky/sdk/lib/framework/fn2.dart |
| +++ b/sky/sdk/lib/framework/fn2.dart |
| @@ -943,24 +943,21 @@ class Text extends Component { |
| // for now, but only for now: |
| class RenderSolidColor extends RenderDecoratedBox { |
| - final double desiredHeight; |
| - final double desiredWidth; |
| + final sky.Size desiredSize; |
| final int backgroundColor; |
| - RenderSolidColor(int backgroundColor, { this.desiredHeight: double.INFINITY, |
| - this.desiredWidth: double.INFINITY }) |
| + RenderSolidColor(int backgroundColor, { this.desiredSize }) |
|
Hixie
2015/05/28 18:45:22
If it's a required argument (which it appears it n
|
| : backgroundColor = backgroundColor, |
| super(new BoxDecoration(backgroundColor: backgroundColor)); |
| BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) { |
| return new BoxDimensions.withConstraints(constraints, |
|
Hixie
2015/05/28 18:45:22
What if desiredSize is null?
|
| - height: desiredHeight, |
| - width: desiredWidth); |
| + width: desiredSize.width, |
| + height: desiredSize.height); |
| } |
| void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) { |
| - width = constraints.constrainWidth(desiredWidth); |
| - height = constraints.constrainHeight(desiredHeight); |
| + size = constraints.constrain(desiredSize); |
| layoutDone(); |
| } |
| @@ -983,7 +980,7 @@ class Rectangle extends RenderNodeWrapper { |
| final int color; |
| RenderSolidColor root; |
| - RenderSolidColor createNode() => new RenderSolidColor(color, desiredWidth: 40.0, desiredHeight: 130.0); |
| + RenderSolidColor createNode() => new RenderSolidColor(color, desiredSize: new sky.Size(40.0, 130.0)); |
| static final Rectangle _emptyRectangle = new Rectangle(0); |
| RenderNodeWrapper get emptyNode => _emptyRectangle; |