Skip to content

Commit

Permalink
Allow 'startCoords' in snap.relativePoints
Browse files Browse the repository at this point in the history
Closes #135
  • Loading branch information
taye committed Dec 16, 2014
1 parent 3b501ee commit 1ca1164
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -1599,10 +1599,14 @@

if (rect && snap.relativePoints && snap.relativePoints.length) {
for (var i = 0; i < snap.relativePoints.length; i++) {
this.snapOffsets.push({
x: this.startOffset.left - (width * snap.relativePoints[i].x),
y: this.startOffset.top - (height * snap.relativePoints[i].y)
});
var relative = snap.relativePoints[i];

this.snapOffsets.push(relative === 'startCoords'
? this.startCoords.page
: {
x: this.startOffset.left - (width * relative.x),
y: this.startOffset.top - (height * relative.y)
});
}
}
else {
Expand Down

0 comments on commit 1ca1164

Please sign in to comment.