![]() |
CRect:Union
The Union method creates the union of this CRect with another CRect. The resulting CRect has the greatest absolute extent in each dimension.
|
CRect:Union( CRect2 )
|
The following script fragment replaces the data members of CRect R with its union with another CRect:
|
R = CRect:new() |
-- create a CRect object |
|
R:Set(100,200,300,600) |
|
|
R2 = CRect:new() |
-- create another CRect object |
|
R2:Set(-100,250,200,800) |
|
|
R:Union(R2) |
-- updates R, does not change R2 |
|
Printf("%lg:%lg, %lg:%lg\n", R:Get()) |
-- result: -100:250, 200:800. |