RectangleF
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; }