diff options
author | Valerio Virgillito | 2012-04-30 14:49:49 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-30 14:49:49 -0700 |
commit | 6b1a6994d98a18b45016b97ac8d81483109a586c (patch) | |
tree | cda8a39f8813fb5c0f9b4fb1d37007e6ec971128 /js/tools/PanTool.js | |
parent | c8fac64d4ad8ac18744a17a5e0f0d17204355fd6 (diff) | |
parent | 48e442977ef1630e0f664265a7142320b55d7d20 (diff) | |
download | ninja-6b1a6994d98a18b45016b97ac8d81483109a586c.tar.gz |
Merge pull request #182 from ericmueller/Canvas-interaction
Canvas interaction
Diffstat (limited to 'js/tools/PanTool.js')
-rwxr-xr-x | js/tools/PanTool.js | 20 |
1 files 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, | |||
331 | 331 | ||
332 | if (!this._altKeyDown) | 332 | if (!this._altKeyDown) |
333 | delta[2] = 0; | 333 | delta[2] = 0; |
334 | var transMat = Matrix.Translation( delta ); | 334 | |
335 | this._worldPt = wPt; | 335 | // limit the change |
336 | var ucMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.documentRoot); | ||
337 | var tooMuch = false | ||
338 | if ((ucMat[12] > 12000) && (delta[0] > 0)) tooMuch = true; | ||
339 | if ((ucMat[12] < -12000) && (delta[0] < 0)) tooMuch = true; | ||
340 | if ((ucMat[13] > 12000) && (delta[1] > 0)) tooMuch = true; | ||
341 | if ((ucMat[13] < -12000) && (delta[1] < 0)) tooMuch = true; | ||
342 | if ((ucMat[14] > 12000) && (delta[2] > 0)) tooMuch = true; | ||
343 | if ((ucMat[14] < -12000) && (delta[2] < 0)) tooMuch = true; | ||
344 | if (tooMuch) | ||
345 | { | ||
346 | this._isDrawing = false; | ||
347 | delta = [0,0,0]; | ||
348 | } | ||
349 | else | ||
350 | this._worldPt = wPt; | ||
336 | 351 | ||
337 | // update everything | 352 | // update everything |
353 | var transMat = Matrix.Translation( delta ); | ||
338 | this.applyDeltaMat( transMat ); | 354 | this.applyDeltaMat( transMat ); |
339 | } | 355 | } |
340 | } | 356 | } |