Realbasic.Rect.SplitHorizontal

From Xojo Documentation

Method

Realbasic.Rect.SplitHorizontal(X 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 X axis.

Notes

For example, imagine a rect that is 200 pixels wide by 100 pixels tall. With a call to SplitHorizontal(50), the rect will become 50 pixels wide, and a new rect will be returned that is 150x100, positioned exactly to the right 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 width.

Dim uright As Realbasic.Rect = u.SplitHorizontal(theSize.Width / 2)