RectangleF
public static void IncludePointX(ref RectangleF rect, float xToInclude) { if (xToInclude < rect.X) { rect.Width = rect.Right - xToInclude; rect.X = xToInclude; } else if (xToInclude > rect.Right) rect.Width = xToInclude - rect.X; }