union

Creates a new Rect instance that encloses the two rectangles given as arguments.

Example

<script>
var geom = kendo.geometry;
var rect1 = new geom.Rect([0, 0], [10, 10]);
var rect2 = new geom.Rect([5, 5], [15, 15]);

// Create union rectangle
var unionRect = geom.Rect.union(rect1, rect2);

console.log("Union origin:", unionRect.origin.x, unionRect.origin.y); // 0, 0
console.log("Union size:", unionRect.size.width, unionRect.size.height); // 20, 20
</script>

Parameters

rectA kendo.geometry.Rect

The first rectangle.

rectB kendo.geometry.Rect

The second rectangle.

Returns

kendo.geometry.Rect The new Rect instance.

In this article
union
Not finding the help you need?
Contact Support