public static RectangleF newRectangleF(Single left, Single top, Single right, Single bottom) { if (left < 0) left = 0; if (top < 0) top = 0; if (right < left) right = left; if (bottom < top) bottom = top; return new RectangleF(left, top, right-left, bottom-top); }