Calling LayoutChildren() and then checking m_needsLayout (which was set to false at the top of the function) to decide whether to call LayoutChildren() again. If it's correct it needs a comment to explain that sometimes layout requires two passes and m_needsLayout can be set again during the first LayoutChildren call.