aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PanTool.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-24 00:07:23 -0700
committerJose Antonio Marquez2012-05-24 00:07:23 -0700
commit5914c5b2209c4b8daac4249bb76cda5c9314c4e6 (patch)
treef0910e57f64d1638f00bf7f6449d479fb377bfac /js/tools/PanTool.js
parent16decc5726eafbb25675c61be6df85a378ac1fac (diff)
downloadninja-5914c5b2209c4b8daac4249bb76cda5c9314c4e6.tar.gz
Cleaning up referencing to 'documentRoot' and '_document'
Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view.
Diffstat (limited to 'js/tools/PanTool.js')
-rwxr-xr-xjs/tools/PanTool.js16
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 );