taye/interact.js — pull request #72 by taye (2014-09-03 13:01:42+00:00)
Title: Option for snap and restrict to be relative to the element's position and dimentions

```javascript
interact('*').snap({
elementOrigin: { x: 0, y: 0 }
});
```

elementOrigin.x/y are scalars specifying the position on the element to
which snapping should be relative.

```
{x: 0, y: 0} is the top left
{x: 0.5, y: 0.5} is the center
{x: 1, y: 1} is the bottom right
```

---

```javascript
interact('*').restrict({
elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
});
```

For the left and right properties, 0 means the very left of the element
and 1 means the very right. For top and bottom, 0 means the top of the
element and 1 means the bottom.

`{ top: 0.25, left: 0.25, bottom: 0.75, right: 0.75 }` would result in a
quarter of the element being allowed to hang over the restriction edges.

Closes #47
Closes #59