From 29009537cf1227b39cba259da7827b677c54bbf8 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 30 Dec 2018 20:37:15 -0600 Subject: [PATCH] Flattened containers are sorted by area --- recursive-macro.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recursive-macro.js b/recursive-macro.js index 659194b..8b277b1 100644 --- a/recursive-macro.js +++ b/recursive-macro.js @@ -501,6 +501,8 @@ function flatten(thing) { list.push(obj); }); + list.sort(function(x,y) { return areas[x.name] < areas[y.name] }) + return new Container(list); }