[Overview][Types][Procedures and functions][Variables][Index] | Reference for unit 'LCLIntf' (#lcl)

# UnionRect

Computes the bounding box of the union of two rectangles.

## Declaration

Source position: winapih.inc line 361

`function UnionRect(`
`var DestRect: TRect;`
`const SrcRect1: TRect;`
`const SrcRect2: TRect`
`):Boolean;`

## Function result

False when the resulting rectangle is empty, i.e. when both source rectangles are empty.

## Description

The bounding box is the rectangle that covers the entire resulting area. Here the result covers both rectangles.

The rectangles can be disjoint.

Rectangles with a zero or negative width or height are treated as empty rectangles (ignored).