pinrectangle(
LARGERECTANGLE
,
SMALLERRECTANGLE
)

The pinrectangle( function pins a rectangle within the bounds of a larger rectangle.


Parameters

This function has two parameters:

largerectangle – is a large rectangle.

smallerrectangle – is a smaller rectangle.


Description

The pinrectangle( function pins a rectangle within the bounds of a larger rectangle. In other words, this function ensures that none of the edges of the smaller rectangle are outside the edges of the larger rectangle. This function doesn’t change the size of the rectangle, it just adjusts its position if necessary to ensure that it is inside the larger rectangle.

This example checks to see if the current window is entirely within the main screen, and if not, it moves it so that the window is entirely visible on the main screen.

local wrect
wrect = pinrectangle(info("screenrectangle"),info("windowrectangle"))
if wrect <> info("windowrectangle")
    zoomwindowrectangle wrect
endif

See Also


History

VersionStatusNotes
10.0NewNew in this version.