private Vector3 calculatePopupPosition( int height )
{
var p2u = PixelsToUnits();
var controlPosition = this.transform.position + pivot.TransformToUpperLeft( size ) * p2u;
var down = getScaledDirection( Vector3.down );
var offset = transformOffset( listOffset );
var positionBelow = controlPosition + ( offset + ( down * Size.y ) ) * p2u;
var positionAbove = controlPosition + ( offset - ( down * popup.Size.y ) ) * p2u;
if( listPosition == PopupListPosition.Above )
return positionAbove;
else if( listPosition == PopupListPosition.Below )
return positionBelow;
var screenSize = GetManager().GetScreenSize();
var listBottom = GetAbsolutePosition().y + Height + height;
if( listBottom >= screenSize.y )
return positionAbove;
return positionBelow;
}