From 0f2b7cf2e1aae16e3cf4e699ab7e3ca83deb1529 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 23 Apr 2012 11:32:15 -0700 Subject: limits --- js/tools/PanTool.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js index 0537a27b..ce7606a1 100755 --- a/js/tools/PanTool.js +++ b/js/tools/PanTool.js @@ -331,10 +331,26 @@ exports.PanTool = Montage.create(toolBase, if (!this._altKeyDown) delta[2] = 0; - var transMat = Matrix.Translation( delta ); - this._worldPt = wPt; + + // limit the change + var ucMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.documentRoot); + var tooMuch = false + if ((ucMat[12] > 12000) && (delta[0] > 0)) tooMuch = true; + if ((ucMat[12] < -12000) && (delta[0] < 0)) tooMuch = true; + if ((ucMat[13] > 12000) && (delta[1] > 0)) tooMuch = true; + if ((ucMat[13] < -12000) && (delta[1] < 0)) tooMuch = true; + if ((ucMat[14] > 12000) && (delta[2] > 0)) tooMuch = true; + if ((ucMat[14] < -12000) && (delta[2] < 0)) tooMuch = true; + if (tooMuch) + { + this._isDrawing = false; + delta = [0,0,0]; + } + else + this._worldPt = wPt; // update everything + var transMat = Matrix.Translation( delta ); this.applyDeltaMat( transMat ); } } -- cgit v1.2.3