redconservatory
redconservatory

Reputation: 21924

Way to add rectangles to get the bounds of all the rectangles

Is there a way to add a grid of rectangles together so that you can get a "container" rectangle (the bounds) of all the rectangles put together?

Upvotes: 0

Views: 327

Answers (1)

Patrick
Patrick

Reputation: 15717

Look at the union function from the Rectangle class

Union : Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles.

Upvotes: 1

Related Questions