System.Drawing.GraphicsUtil.IncludePointY C# (CSharp) Method

IncludePointY() public static method

Checks if y-coordinate is contained within the RectangleF structure and extends rectangle bounds if neccessary to include the point.
public static IncludePointY ( RectangleF &rect, float yToInclude ) : void
rect RectangleF /// RectangleF to check. ///
yToInclude float /// y-coordinate to include. ///
return void
        public static void IncludePointY(ref RectangleF rect, float yToInclude)
        {
            if (yToInclude < rect.Y) {
                rect.Height = rect.Bottom - yToInclude;
                rect.Y = yToInclude;
            }
            else if (yToInclude > rect.Bottom)
                rect.Height = yToInclude - rect.Y;
        }