# rectangl Specification Sheet

Portable Object Compiler (c) 1997. All Rights Reserved.

# Rectangle

Inherits from: Object

## Class Description

Rectangle instances are pairs of Point objects. It is mostly Squeak and Stepstone ICpak101 compatible.

## Method types

### Creation

- new
- origin:corner:
- origin:extent:
- origin::corner::
- origin::extent::
- free

### Motion

- origin:
- corner:
- origin:corner:
- extent::
- extent:
- origin::
- corner::

### Comparing

- contains:
- hash
- isEqual:

### Interrogation

- left
- right
- top
- bottom
- width
- height
- origin
- corner

### Arithmetic

- moveBy:

### Printing

- printOn:

## Methods

### new

> +new

Returns a new rectangle with origin and corner at (0,0).

### origin:corner:

> +origin:pcorner:q

Returns a new rectangle with origin and corner set to p and q.

### origin:extent:

> +origin:pextent:q

### origin::corner::

> +origin:(int)x1:(int)y1corner:(int)x2:(int)y2

### origin::extent::

> +origin:(int)x:(int)yextent:(int)w:(int)h

### free

> -free

Frees the origin and corner of the Point too.

### origin:

> -origin:p

### corner:

> -corner:q

### origin:corner:

> -origin:pcorner:q

Sets origin and corner to p and q.

### extent::

> -extent:(int)w:(int)h

### extent:

> -extent:q

### origin::

> -origin:(int)x1:(int)y1

### corner::

> -corner:(int)x1:(int)y1

### contains:

> - (BOOL)contains:aPoint

Yes if inside, or on a border of, the rectangle.

### hash

> - (unsigned)hash

### isEqual:

> - (BOOL)isEqual:aRectangle

Returns YES if aRectangle is some kind of rectangle, and if corner and origin are equal.

### left

> - (int)left

### right

> - (int)right

### top

> - (int)top

### bottom

> - (int)bottom

### width

> - (int)width

### height

> - (int)height

### origin

> -origin

### corner

> -corner

### moveBy:

> -moveBy:aPoint

### printOn:

> -printOn:(IOD)aFile