RenderObject.flushLayout should loop until _nodesNeedingLayout is empty

This commit is contained in:
Hans Muller 2015-08-24 12:41:27 -07:00
parent 9a493c15e9
commit a61f0f5021

View File

@ -407,12 +407,15 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
sky.tracing.begin('RenderObject.flushLayout'); sky.tracing.begin('RenderObject.flushLayout');
_debugDoingLayout = true; _debugDoingLayout = true;
try { try {
List<RenderObject> dirtyNodes = _nodesNeedingLayout; // TODO(ianh): assert that we're not allowing previously dirty nodes to redirty themeselves
_nodesNeedingLayout = new List<RenderObject>(); while(_nodesNeedingLayout.isNotEmpty) {
dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) { List<RenderObject> dirtyNodes = _nodesNeedingLayout;
if (node._needsLayout && node.attached) _nodesNeedingLayout = new List<RenderObject>();
node.layoutWithoutResize(); dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) {
}); if (node._needsLayout && node.attached)
node.layoutWithoutResize();
});
}
} finally { } finally {
_debugDoingLayout = false; _debugDoingLayout = false;
sky.tracing.end('RenderObject.flushLayout'); sky.tracing.end('RenderObject.flushLayout');