diff options
author | Eric Guzman | 2012-05-29 15:29:11 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-29 15:29:11 -0700 |
commit | 25ac55c285bb4850118c644dc57adaeda5b9a859 (patch) | |
tree | b645941d7916716cbaf4860355df4101fc0f4c3c /js/tools/PanTool.js | |
parent | 1fda3cea5f8dced1e14533969722e30b8ea1e6fa (diff) | |
parent | 58e454c828abf0b64fa62120359bcd78a0d34ac4 (diff) | |
download | ninja-25ac55c285bb4850118c644dc57adaeda5b9a859.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into CSSPanelUpdates
Diffstat (limited to 'js/tools/PanTool.js')
-rwxr-xr-x | js/tools/PanTool.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js index 5cfeec75..39f89d17 100755 --- a/js/tools/PanTool.js +++ b/js/tools/PanTool.js | |||
@@ -47,8 +47,8 @@ exports.PanTool = Montage.create(toolBase, | |||
47 | HandleLeftButtonDown: { | 47 | HandleLeftButtonDown: { |
48 | value : function ( event ) { | 48 | value : function ( event ) { |
49 | // Determine the maximum horizontal and vertical scroll values | 49 | // Determine the maximum horizontal and vertical scroll values |
50 | this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this.application.ninja.stage._canvas.width - 11; | 50 | this._maxHorizontalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollWidth - this.application.ninja.stage._canvas.width - 11; |
51 | this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this.application.ninja.stage._canvas.height - 11; | 51 | this._maxVerticalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollHeight - this.application.ninja.stage._canvas.height - 11; |
52 | if((this._maxHorizontalScroll > 0) || (this._maxVerticalScroll > 0) || this._altKeyDown) | 52 | if((this._maxHorizontalScroll > 0) || (this._maxVerticalScroll > 0) || this._altKeyDown) |
53 | { | 53 | { |
54 | this._isDrawing = true; | 54 | this._isDrawing = true; |
@@ -121,7 +121,7 @@ exports.PanTool = Montage.create(toolBase, | |||
121 | { | 121 | { |
122 | value: function () | 122 | value: function () |
123 | { | 123 | { |
124 | var uc = this.application.ninja.currentDocument.documentRoot; | 124 | var uc = this.application.ninja.currentDocument.model.documentRoot; |
125 | //var uc = documentManagerModule.DocumentManager.activeDocument | 125 | //var uc = documentManagerModule.DocumentManager.activeDocument |
126 | var ucMat = viewUtils.getMatrixFromElement(uc); | 126 | var ucMat = viewUtils.getMatrixFromElement(uc); |
127 | 127 | ||
@@ -152,7 +152,7 @@ exports.PanTool = Montage.create(toolBase, | |||
152 | 152 | ||
153 | delta *= zoom; | 153 | delta *= zoom; |
154 | 154 | ||
155 | var uc = this.application.ninja.currentDocument.documentRoot; | 155 | var uc = this.application.ninja.currentDocument.model.documentRoot; |
156 | var ucMat = viewUtils.getMatrixFromElement(uc); | 156 | var ucMat = viewUtils.getMatrixFromElement(uc); |
157 | var offset = viewUtils.getElementOffset( uc ); | 157 | var offset = viewUtils.getElementOffset( uc ); |
158 | //console.log( "uc offset: " + offset[0] ); | 158 | //console.log( "uc offset: " + offset[0] ); |
@@ -224,7 +224,7 @@ exports.PanTool = Montage.create(toolBase, | |||
224 | if (elt) | 224 | if (elt) |
225 | { | 225 | { |
226 | // get the userContent object (stage) and its matrix | 226 | // get the userContent object (stage) and its matrix |
227 | var userContent = this.application.ninja.currentDocument.documentRoot; | 227 | var userContent = this.application.ninja.currentDocument.model.documentRoot; |
228 | var ucMat = viewUtils.getMatrixFromElement(userContent); | 228 | var ucMat = viewUtils.getMatrixFromElement(userContent); |
229 | 229 | ||
230 | var localToGlobalMat = viewUtils.getLocalToGlobalMatrix( elt ); | 230 | var localToGlobalMat = viewUtils.getLocalToGlobalMatrix( elt ); |
@@ -358,7 +358,7 @@ exports.PanTool = Montage.create(toolBase, | |||
358 | delta[2] = 0; | 358 | delta[2] = 0; |
359 | 359 | ||
360 | // limit the change | 360 | // limit the change |
361 | var ucMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.documentRoot); | 361 | var ucMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.model.documentRoot); |
362 | var tooMuch = false; | 362 | var tooMuch = false; |
363 | if ((ucMat[12] > 12000) && (delta[0] > 0)) tooMuch = true; | 363 | if ((ucMat[12] > 12000) && (delta[0] > 0)) tooMuch = true; |
364 | if ((ucMat[12] < -12000) && (delta[0] < 0)) tooMuch = true; | 364 | if ((ucMat[12] < -12000) && (delta[0] < 0)) tooMuch = true; |
@@ -397,7 +397,7 @@ exports.PanTool = Montage.create(toolBase, | |||
397 | value: function( transMat ) | 397 | value: function( transMat ) |
398 | { | 398 | { |
399 | // update the user content matrix | 399 | // update the user content matrix |
400 | var uc = this.application.ninja.currentDocument.documentRoot; | 400 | var uc = this.application.ninja.currentDocument.model.documentRoot; |
401 | var ucMat = viewUtils.getMatrixFromElement(uc); | 401 | var ucMat = viewUtils.getMatrixFromElement(uc); |
402 | var newUCMat = glmat4.multiply( transMat, ucMat, [] ); | 402 | var newUCMat = glmat4.multiply( transMat, ucMat, [] ); |
403 | viewUtils.setMatrixForElement( uc, newUCMat ); | 403 | viewUtils.setMatrixForElement( uc, newUCMat ); |
@@ -412,7 +412,7 @@ exports.PanTool = Montage.create(toolBase, | |||
412 | value: function() | 412 | value: function() |
413 | { | 413 | { |
414 | // get the userContent object | 414 | // get the userContent object |
415 | var userContent = this.application.ninja.currentDocument.documentRoot; | 415 | var userContent = this.application.ninja.currentDocument.model.documentRoot; |
416 | 416 | ||
417 | // get a matrix from user content world space to the screen | 417 | // get a matrix from user content world space to the screen |
418 | viewUtils.pushViewportObj( userContent ); | 418 | viewUtils.pushViewportObj( userContent ); |