Skip to content

Commit

Permalink
Zoom threshold checked correctly against the previous matrix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Munday committed Nov 12, 2015
1 parent 4a5a151 commit 10d12d1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions snap.svg.zpd.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,17 @@
*/
var _setCTM = function setCTM(element, matrix, threshold) {
if (threshold && typeof threshold === 'object') { // array [0.5,2]
if (matrix.a <= threshold[0]) {
var oldMatrix = Snap(element).transform().globalMatrix;

if (matrix.a < oldMatrix.a && matrix.a < threshold[0]) {
return;
} else if (matrix.a > oldMatrix.a && matrix.a > threshold[1]) {
return;
}
if (matrix.d >= threshold[1]) {

if (matrix.d < oldMatrix.d && matrix.d < threshold[0]) {
return;
} else if (matrix.d > oldMatrix.d && matrix.d > threshold[1]) {
return;
}
}
Expand Down

0 comments on commit 10d12d1

Please sign in to comment.