Skip to content
/ rect Public

Rect prototype for whatever, canvas, selection rects etc

Notifications You must be signed in to change notification settings

component/rect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rect prototype for whatever, canvas, selection rects etc

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •