public override void layout()
{
layout( 0, 0, width, height );
if( _round )
{
for( int i = 0, n = _cells.Count; i < n; i++ )
{
var c = _cells[i];
var elementWidth = Mathf.round( c.elementWidth );
var elementHeight = Mathf.round( c.elementHeight );
var elementX = Mathf.round( c.elementX );
var elementY = Mathf.round( c.elementY );
c.setElementBounds( elementX, elementY, elementWidth, elementHeight );
if( c.element != null )
c.element.setBounds( elementX, elementY, elementWidth, elementHeight );
}
}
else
{
for( int i = 0, n = _cells.Count; i < n; i++ )
{
var c = _cells[i];
var elementY = c.elementY;
c.setElementY( elementY );
if( c.element != null )
c.element.setBounds( c.elementX, elementY, c.elementWidth, c.elementHeight );
}
}
// Validate children separately from sizing elements to ensure elements without a cell are validated.
for( int i = 0, n = children.Count; i < n; i++ )
{
var child = children[i];
if( child is ILayout )
( (ILayout)child ).validate();
}
}