From 31e7f8abbec9c2b42ad43048c2355d0fa38fd92e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 23 Mar 2019 11:55:44 +0100 Subject: [PATCH] Remove snapGuides option from Dragger --- src/utils/Dragger.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/utils/Dragger.js b/src/utils/Dragger.js index 1b669a328..55f872c05 100644 --- a/src/utils/Dragger.js +++ b/src/utils/Dragger.js @@ -42,18 +42,15 @@ export default class Dragger { */ getPosition: null, - // Offset before snap to guides - snapGuides: 1, - - // Offset before snap to guides - snapOffset: 5, - // Static guides to be snapped guidesStatic: null, // Target guides that will snap to static one guidesTarget: null, + // Offset before snap to guides + snapOffset: 5, + // Document on which listen to pointer events doc: 0, @@ -107,7 +104,7 @@ export default class Dragger { */ drag(ev) { const { opts } = this; - const { onDrag, snapGuides } = opts; + const { onDrag } = opts; const { startPointer } = this; const currentPos = this.getPointerPos(ev); const delta = { @@ -140,7 +137,7 @@ export default class Dragger { this.lockedAxis = lockedAxis; moveDelta(delta); - if (snapGuides) { + if (this.guidesTarget.length) { const { newDelta, trgX, trgY } = this.snapGuides(deltaPre); (trgX || trgY) && moveDelta(newDelta); }