Browse Source

Remove snapGuides option from Dragger

pull/1918/head
Artur Arseniev 7 years ago
parent
commit
31e7f8abbe
  1. 13
      src/utils/Dragger.js

13
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);
}

Loading…
Cancel
Save