Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 | |
| 2 import 'dart:sky' as sky; | |
| 3 import '../fn.dart'; | |
| 4 | |
| 5 class BlockLayout extends LayoutContainer { | |
| 6 | |
| 7 BlockLayout({ | |
| 8 Object key, | |
| 9 List<UINode> children, | |
| 10 Style style, | |
| 11 String inlineStyle | |
| 12 }) : super( | |
| 13 key: key, | |
| 14 children: children, | |
| 15 style: style, | |
| 16 inlineStyle: inlineStyle | |
| 17 ); | |
| 18 | |
| 19 void layout(sky.Element skyNode) { | |
| 20 double y = 0.0; | |
|
ojan
2015/04/08 20:08:11
FYI, here you should be doing skyNode.width = skyN
Hixie
2015/04/09 16:26:39
why wouldn't the parent set the width?
| |
| 21 skyNode.getChildElements().forEach((child) { | |
| 22 child.width = skyNode.width; | |
| 23 child.setNeedsLayout(); // with this line, sky crashes. without it, nothin g renders as a child of this LayoutContainer | |
| 24 child.layout(); | |
| 25 child.x = 0.0; | |
| 26 child.y = y; | |
| 27 y += child.height; | |
| 28 }); | |
| 29 skyNode.height = y; | |
| 30 } | |
| 31 } | |
| OLD | NEW |