CRect:Normalize
The Normalize method adjust the CRect limits to be positive definite, so that xmax >= xmin and ymax >= ymin.
CRect:Normalize() |
The following script fragment normalizes the CRect:
R = CRect:new() |
-- 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. |