Commit a61f0f50 authored by Hans Muller's avatar Hans Muller

RenderObject.flushLayout should loop until _nodesNeedingLayout is empty

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