unionrectangle(
RECTANGLE1
,
RECTANGLE2
)

The unionrectangle( function creates a rectangle by combining two rectangles. The new rectangle is large enough to exactly cover both of the input rectangles.


Parameters

This function has two parameters:

rectangle1 – is the first rectangle.

rectangle2 – is the second rectangle.


Description

The unionrectangle( function creates a rectangle by combining two rectangles. The new rectangle is large enough to exactly cover both of the input rectangles. A rectangle is 32 bytes of raw binary data (see Binary Data, Graphic Coordinates).

The illustration below shows how this function combines two rectangles, creating a third rectangle which contains both of the original two:

unionrectangle()
unionrectangle()

The unionrectangle( function can be used to check if a smaller rectangle is inside a larger rectangle. If the smaller rectangle is completely inside the larger rectangle, the result of this function will be the same as the larger rectangle. The procedure below checks to see if the current window is completely inside the main screen, or if it partially extends past the edge of the main screen.

if unionrectangle( info("windowrectangle"), info("screenrectangle") ) <> info("screenrectangle")
    message "This window sticks out from the main screen"
endif

See Also


History

VersionStatusNotes
10.0UpdatedUnlike Panorama 6 and earlier, the parameters to this function are floating point values instead of integers (it will also accept integers). Also, the rectangle produced by this function is a 32 byte binary value, instead of an 8 byte text value.