The operator | function determines the intersection of two rectangles by comparing their components and selecting the left-most x1, top-most y1, right-most x2, and bottom-most y2. The following expression is used to determine the result:
(result.x1, result.y1, result.x2, result.y2) = (min(r1.x1, r2.x1), min(r1.y1, r2.y1), max(r1.x2, r2.x2), max(r1.y2, r2.y2)
Parameters |
Description |
const Rect<T> & r |
The second of two passed rectangles whose components are compared to those of a first rectangle in order to determine the union. |
A new Rect whose components are determined by the union of two passed rectangles.