Commit 51c670e6 authored by Adam Barth's avatar Adam Barth

Address Ian's comments on layout2.dart

R=ianh@google.com

Review URL: https://codereview.chromium.org/1152603002
parent af9a06c0
...@@ -18,8 +18,8 @@ class RenderSolidColor extends RenderDecoratedBox { ...@@ -18,8 +18,8 @@ class RenderSolidColor extends RenderDecoratedBox {
} }
void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) { void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) {
setWidth(constraints, constraints.maxWidth); width = constraints.constrainWidth(constraints.maxWidth);
setHeight(constraints, 200.0); height = constraints.constrainHeight(200.0);
layoutDone(); layoutDone();
} }
...@@ -57,7 +57,8 @@ void main() { ...@@ -57,7 +57,8 @@ void main() {
view.setBeginFrameCallback(beginFrame); view.setBeginFrameCallback(beginFrame);
var root = new RenderBlock( var root = new RenderBlock(
decoration: new BoxDecoration(backgroundColor: 0xFF00FFFF)); decoration: new BoxDecoration(backgroundColor: 0xFF00FFFF),
padding: const EdgeDims(10.0, 10.0, 10.0, 10.0));
root.add(new RenderSolidColor(0xFF00FF00)); root.add(new RenderSolidColor(0xFF00FF00));
root.add(new RenderSolidColor(0xFF0000FF)); root.add(new RenderSolidColor(0xFF0000FF));
......
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