Xojo.Core.Rect.Union

From Xojo Documentation

Method

Xojo.Core.Rect.Union(Other As Xojo.Core.Rect) As Xojo.Core.Rect

Supported for all project types and targets.

Creates a new rect that contains both rects.

Sample Code

Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Var rect2 As New Xojo.Core.Rect(5, 5, 10, 10)
Var rect3 As Xojo.Core.Rect = rect1.Union(rect2)