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

Unified Diff: sky/examples/style/block-layout.sky

Issue 850593003: Examples: move markAsLaidOut() to just before the return, so the asserts work (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | sky/examples/style/hex-layout.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/style/block-layout.sky
diff --git a/sky/examples/style/block-layout.sky b/sky/examples/style/block-layout.sky
index a707af0e54a430c0a11509ce52ac31da6c650ae8..7076685fb39d84466fe44c66871230c542c6be4f 100644
--- a/sky/examples/style/block-layout.sky
+++ b/sky/examples/style/block-layout.sky
@@ -7,7 +7,6 @@ SKY MODULE
<script>
module.exports.BlockLayoutManager = class BlockLayoutManager extends sky.LayoutManager {
function layout(width, height) {
- this.markAsLaidOut();
if (width == null)
width = this.getIntrinsicWidth().value;
let autoHeight = false;
@@ -31,11 +30,15 @@ SKY MODULE
}
if (autoHeight)
height = y;
+ this.markAsLaidOut();
return {
width: width,
height: height,
}
}
+ function layoutDescendants() {
+ this.layout(node.width, node.height);
+ }
function getIntrinsicWidth() {
let width = this.node.getProperty('width');
if (typeof width != 'number') {
« no previous file with comments | « no previous file | sky/examples/style/hex-layout.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698