// Updates the layout if necessary. void ElementDocument::_UpdateLayout() { layout_dirty = false; lock_layout++; Vector2f containing_block(0, 0); if (GetParentNode() != NULL) containing_block = GetParentNode()->GetBox().GetSize(); LayoutEngine layout_engine; layout_engine.FormatElement(this, containing_block); lock_layout--; }
// Updates the layout if necessary. void ElementDocument::UpdateLayout() { if (layout_dirty) { if (lock_layout) return; lock_layout = true; GetStyle()->UpdateDefinition(); Vector2f containing_block(0, 0); if (GetParentNode() != NULL) containing_block = GetParentNode()->GetBox().GetSize(); LayoutEngine layout_engine; layout_engine.FormatElement(this, containing_block); layout_dirty = false; lock_layout = false; } }