Makes the dimensions of DlxRect equal to the union of the two source rectangles. The union is the smallest rectangle that contains both source rectangles.

syntaxSyntax:
DlxRect.Union(rect)
DlxRect.Union(rect1, rect2)

Parameters

Parameter Description
rect DlxRect object that contains a source rectangle.
rect1 DlxRect object that contains a source rectangle.
rect2 DlxRect object that contains a source rectangle.

Return Value

Returns true if the union is not empty; false if the union is empty.

Example

  Copy codeCopy code
var r1 = new DlxRect(100,  0, 200, 300);
var r2 = new DlxRect(0, 100, 300, 200);
var r = new DlxRect();
r.Union(r1, r2);
DlxApp.Printf("r.left=%.2f, r.bottom=%.2f, r.right=%.2f, r.top=%.2f", r.left, r.bottom, r.right, r.top);
r.CopyRect(r1);
r.Union(r2);
DlxApp.Printf("r.left=%.2f, r.bottom=%.2f, r.right=%.2f, r.top=%.2f", r.left, r.bottom, r.right, r.top);

See also