Skip to content

Latest commit

 

History

History
42 lines (24 loc) · 797 Bytes

Readme.md

File metadata and controls

42 lines (24 loc) · 797 Bytes

rect

Rect prototype (abstract, use it for dom, canvas, etc)

Installation

$ component install component/rect

API

Rect()

Initialize a new Rect with the given position and dimensions, or an object with the same properties.

Rect.moveTo(left:Number, top:Number)

Move to (left, top).

Rect.size(width:Number, height:Number)

Resize to width / height

Rect.to(right:Number, bottom:Number)

Move the second point to (right, bottom).

Rect.intersects(other:Object)

Returns true if two rects overlap.

License

MIT