diff --git a/interact.js b/interact.js index 26ad6a484..1fee928d7 100644 --- a/interact.js +++ b/interact.js @@ -1577,7 +1577,8 @@ var rect = interactable.getRect(element), snap = interactable.options[this.prepared.name].snap, restrict = interactable.options[this.prepared.name].restrict, - width, height; + width, height, + origin = getOriginXY(interactable, element); if (rect) { this.startOffset.left = this.startCoords.page.x - rect.left; @@ -1602,7 +1603,10 @@ var relative = snap.relativePoints[i]; this.snapOffsets.push(relative === 'startCoords' - ? this.startCoords.page + ? { + x: this.startCoords.page.x - origin.x, + y: this.startCoords.page.y - origin.y + } : { x: this.startOffset.left - (width * relative.x), y: this.startOffset.top - (height * relative.y)