MonoMobile.Views.VerticalAlignmnentLabel.TextRectForBounds C# (CSharp) Method

TextRectForBounds() public method

public TextRectForBounds ( RectangleF bounds, int numberOfLines ) : RectangleF
bounds System.Drawing.RectangleF
numberOfLines int
return System.Drawing.RectangleF
		public override RectangleF TextRectForBounds(RectangleF bounds, int numberOfLines)
		{
			RectangleF calculatedRect = base.TextRectForBounds(bounds, numberOfLines);
 
			if (_VerticalAlignment != UIVerticalAlignment.Top)
			{   
				if (_VerticalAlignment == UIVerticalAlignment.Bottom)
				{ 
					bounds.Y += bounds.Height - calculatedRect.Height;    //move down by difference
				}
				else
				{    
					bounds.Y += (bounds.Height - calculatedRect.Height) / 2; 
				} 
			} 

			bounds.Height = calculatedRect.Height;    //always the calculated height 

			return (bounds); 
		} 
	}