Rect:
Filter:
Classes | Geometry

Rect : Object

Rectangle
Source: Rect.sc

Class Methods

Rect.new(left: 0, top: 0, width: 0, height: 0)

Return a new Rect with the given upper left corner and dimensions.

Rect.newSides(left: 0, top: 0, right: 0, bottom: 0)

Return a new Rect with the given boundaries.

Rect.fromPoints(pt1, pt2)

Return a new Rect defined by the given Points.

Inherited class methods

Undocumented class methods

Rect.aboutPoint(point, dx, dy)

Rect.fromArray(array)

Rect.fromRect(rect)

Instance Methods

.left

.left = value

Get or set the value of the boundary.

.top

.top = value

Get or set the value of the boundary.

.right

.right = r

Get the value of the boundary.

.bottom

.bottom = b

Get the value of the boundary.

.set(argLeft: 0, argTop: 0, argWidth: 0, argHeight: 0)

Set the boundaries to the given values.

.setExtent(argWidth: 0, argHeight: 0)

Set the dimensions.

.width

.width = value

Set or get the width.

.height

.height = value

Set or get the height.

.origin

.origin = pt

Return the upper left corner as a Point.

.extent

.extent = pt

Return a Point whose x value is the height and whose y value is the width.

.leftTop

Return the upper left corner as a Point.

.rightTop

Return the upper right corner as a Point.

.leftBottom

Return the lower left corner as a Point.

.rightBottom

Return the lower right corner as a Point.

.moveBy(h, v)

Returns a new Rect which is offset by x and y.

.moveTo(h, v)

Returns a new Rect whose upper left corner is moved to (x, y).

.moveToPoint(aPoint)

Returns a new Rect whose upper left corner is moved to aPoint.

.resizeBy(h, v)

Returns a new Rect whose dimensions have been changed by (x, y).

.resizeTo(h, v)

Returns a new Rect whose dimensions are (x, y).

.insetBy(h, v)

Returns a new Rect whose boundaries have been inset by (x, y). If only one argument is supplied, it will be used for both x and y.

.insetAll(a, b, c, d)

Returns a new Rect whose boundaries have been inset by the given amounts.

.contains(anObject)

Answers whether aPoint is in the receiver.

.union(aRect)

|(aRect)

Returns a new Rect which contains the receiver and aRect.

.sect(aRect)

&(aRect)

Returns a new Rect which is the intersection of the receiver and aRect.

.minSize(minSize)

Return a new Rect that ensures the minimum dimensions. If either the width or height of the receiver is smaller than the argument of this method, the new Rect will reflect the specified minimum values accordingly.

Arguments:

minSize

minWidth@minHeight.

Inherited instance methods

Undocumented instance methods

+(that)

-(that)

==(that)

.anchorTo(pt, position)

.asArray

.asRect

.asSize

.bounds

.center

.center = center

.centerIn(inRect)

.centerSquare

.containsPoint(aPoint)

.containsRect(aRect)

.draw(color, operation: 2)

.hash

.insetByRect(r)

.intersects(aRect)

.layout(argBounds)

.performBinaryOpOnSomething(aSelector, thing, adverb)

.size

.size = sz