Skip to content

Commit

Permalink
Merge pull request #1 from RiveraGroup/assume_thresholds_for_drag
Browse files Browse the repository at this point in the history
You can drag and zoom out of the thresholds because of the way they d…
  • Loading branch information
Scott Munday committed Dec 16, 2015
2 parents 10d12d1 + 5ce828e commit e9a2842
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 e9a2842

Please sign in to comment.