Nez.UI.HorizontalGroup.computeSize C# (CSharp) Method

computeSize() private method

private computeSize ( ) : void
return void
		void computeSize()
		{
			_sizeInvalid = false;
			_prefWidth = _padLeft + _padRight + _spacing * ( children.Count - 1 );
			_prefHeight = 0;
			for( var i = 0; i < children.Count; i++ )
			{
				var child = children[i];
				if( child is ILayout )
				{
					var layout = (ILayout)child;
					_prefWidth += layout.preferredWidth;
					_prefHeight = Math.Max( _prefHeight, layout.preferredHeight );
				}
				else
				{
					_prefWidth += child.width;
					_prefHeight += Math.Max( _prefHeight, child.height );;
				}
			}

			_prefHeight += _padTop + _padBottom;
			if( _round )
			{
				_prefWidth = Mathf.round( _prefWidth );
				_prefHeight = Mathf.round( _prefHeight );
			}
		}