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 = new_rect()

-- create a CRect object

R:Set(100,-200,300,-600)

-- set xmin > xmax and ymin > ymax

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


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.