A Rect object describes a two-dimensional (graphical) region on screen. The unit used by the dimensions is dependent upon the context, but most often will be in points. Fractional coordinates are allowed (they are stored as floating point numbers).
Rect Type Commands
Rect.new [left], [top], [width], [height] v2.1.2
Returns a new rect with the given properties. If any measurement is not provided the property will be set to zero.
Rect Object Properties
.left v2.1.2
The left edge of the rect. The unit depends on the context, but is usually points.
.top v2.1.2
The top edge of the rect. The unit depends on the context, but is usually points.
.width v2.1.2
The width of the rect. The unit depends on the context, but is usually points.
.height v2.1.2
The height of the rect. The unit depends on the context, but is usually points.
.right v2.1.2
The right edge of the rect. Changing the right edge’s location effectively changes the length. If an attempt is made to set the right edge to a number less than the current left, then the rect will be made zero width.
.bottom v2.1.2
The bottom edge of the rect. Changing the bottom edge’s location effectively changes the length. If an attempt is made to set the bottom edge to a number less than the current top, then the rect will be made zero height.
Rect Object Commands
.isEqualWithTolerance otherRect, [tolerance] v2.1.2
Because rects allow fractional coordinates they may often not be exactly equal. This command returns @true only if the difference between each of the rects’ properties is less than the given tolerance; each property (eg: left) must individually be less than the tolerance. If a tolerance value is not provided, the default is 1.0 (in whatever units the rects describes).
Previous Chapter Range Object |
<< index >> |
Next Chapter Ref Object |