Realbasic.Rect.SplitVertical

From Xojo Documentation

Method

Realbasic.Rect.SplitVertical(Y As Integer) As Realbasic.Rect

New in 2011r2

Supported for all project types and targets.

Divides the rect into two rects at the given point on the Y axis.

Notes

For example, imagine a Rect that is 200 pixels wide by 100 pixels tall. A call to SplitVertical (50) on this rect, the rect will become 50 pixels wide, and a new rect will be returned that is 150x100, positioned exactly to the top of the original rect.

Sample Code

This example is taken from the Paint event of a Canvas. It takes a rect and splits it horizontally at the midpoint of the height.

Dim utop As Realbasic.Rect = u.SplitVertical(theSize.Height / 2)