CRect:Normalize


The Normalize method adjust the CRect limits to be positive definite, so that xmax >= xmin and ymax >= ymin.

Syntax

CRect:Normalize()

Example

The following script normalizes the CRect:

R = NewRect(100,-200,300,-600)

-- create a CRect object

Printf("%lg:%lg, %lg:%lg\n", R:Get())

-- result: 100:-200, 300:-600

R:Normalize()

-- reorder x and y data

Printf("%lg:%lg, %lg:%lg\n", R:Get())

-- result: -200:100, -600:300.

Related Topics

CRect class