Normalizes DlxRect so that both the height and width are positive.

syntaxSyntax:
DlxRect.Normalize()

Return Value

If the operation ends correctly, it returns true otherwise it returns false.

Remarks

The rectangle is normalized for fourth-quadrant positioning. Normalize compares the top and bottom values, and swaps them if the bottom is greater than the top. Similarly, it swaps the left and right values if the left is greater than the right.

Example

  Copy codeCopy code
var r1 = new DlxRect(110, 100, 250, 310);
var r2 = new DlxRect(250, 310, 110, 100);
r1.Normalize();
r2.Normalize();
DlxApp.Printf("r1.left=%.2f, r1.bottom=%.2f, r1.right=%.2f, r1.top=%.2f", r1.left, r1.bottom, r1.right, r1.top);
DlxApp.Printf("r2.left=%.2f, r2.bottom=%.2f, r2.right=%.2f, r2.top=%.2f", r2.left, r2.bottom, r2.right, r2.top);

See also