Skip to content

Commit

Permalink
You can drag and zoom out of the thresholds because of the way they d…
Browse files Browse the repository at this point in the history
…idn't pass along the threshold information.
  • Loading branch information
Scott Munday committed Dec 16, 2015
1 parent 10d12d1 commit 5ce828e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snap.svg.zpd.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
// Pan mode
var p = _getEventPoint(event, zpdElement.data.svg).matrixTransform(zpdElement.data.stateTf);

_setCTM(g, zpdElement.data.stateTf.inverse().translate(p.x - zpdElement.data.stateOrigin.x, p.y - zpdElement.data.stateOrigin.y));
_setCTM(g, zpdElement.data.stateTf.inverse().translate(p.x - zpdElement.data.stateOrigin.x, p.y - zpdElement.data.stateOrigin.y), zpdElement.options.zoomThreshold);

} else if (zpdElement.data.state == 'drag' && zpdElement.options.drag) {

Expand All @@ -367,7 +367,8 @@
zpdElement.data.root.createSVGMatrix()
.translate(dragPoint.x - zpdElement.data.stateOrigin.x, dragPoint.y - zpdElement.data.stateOrigin.y)
.multiply(g.getCTM().inverse())
.multiply(zpdElement.data.stateTarget.getCTM()));
.multiply(zpdElement.data.stateTarget.getCTM()),
zpdElement.options.zoomThreshold);

zpdElement.data.stateOrigin = dragPoint;
}
Expand Down

0 comments on commit 5ce828e

Please sign in to comment.