Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/rect
Rect prototype for whatever, canvas, selection rects etc
https://github.com/component/rect
Last synced: 13 days ago
JSON representation
Rect prototype for whatever, canvas, selection rects etc
- Host: GitHub
- URL: https://github.com/component/rect
- Owner: component
- Created: 2012-12-21T22:14:38.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-08-21T17:31:48.000Z (over 11 years ago)
- Last Synced: 2024-05-08T17:07:17.160Z (8 months ago)
- Language: JavaScript
- Size: 75.2 KB
- Stars: 4
- Watchers: 7
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# rect
Rect prototype (abstract, use it for dom, canvas, etc)
## Installation
$ component install component/rect
## API
- [Rect()](#rect)
- [Rect.moveTo()](#rectmovetoleftnumbertopnumber)
- [Rect.size()](#rectsizewidthnumberheightnumber)
- [Rect.to()](#recttorightnumberbottomnumber)
- [Rect.intersects()](#rectintersectsotherobject)### 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