aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-04 10:20:57 -0700
committerValerio Virgillito2012-06-04 10:20:57 -0700
commitc1ec69879028220b0c3f11ad6e24035bf527802c (patch)
tree043bfe4ec9e08f4f598a4845ae5fbcddacc7c8fb /js/tools
parent3abba04025dbc0daadb08184833a2558c442b8e1 (diff)
parent266460e52831c5b3a3473be420756fd88bb8aced (diff)
downloadninja-c1ec69879028220b0c3f11ad6e24035bf527802c.tar.gz
Merge pull request #264 from mencio/document-bindings-fix
Document bindings fix - Changing the documents architecture to use bindings instead of events
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/PanTool.js1
-rwxr-xr-xjs/tools/PenTool.js2
-rwxr-xr-xjs/tools/RotateStage3DTool.js11
-rwxr-xr-xjs/tools/drawing-tool-base.js2
4 files changed, 13 insertions, 3 deletions
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js
index 39f89d17..a8911c0c 100755
--- a/js/tools/PanTool.js
+++ b/js/tools/PanTool.js
@@ -122,7 +122,6 @@ exports.PanTool = Montage.create(toolBase,
122 value: function () 122 value: function ()
123 { 123 {
124 var uc = this.application.ninja.currentDocument.model.documentRoot; 124 var uc = this.application.ninja.currentDocument.model.documentRoot;
125 //var uc = documentManagerModule.DocumentManager.activeDocument
126 var ucMat = viewUtils.getMatrixFromElement(uc); 125 var ucMat = viewUtils.getMatrixFromElement(uc);
127 126
128 var noTrans = ucMat.slice(); 127 var noTrans = ucMat.slice();
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 10eb03c9..3813123a 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -428,7 +428,7 @@ exports.PenTool = Montage.create(ShapeTool, {
428 var globalMousePos=null, localMousePos=null, stageWorldMousePos = null; 428 var globalMousePos=null, localMousePos=null, stageWorldMousePos = null;
429 var drawingCanvas = this._selectedSubpath.getCanvas(); 429 var drawingCanvas = this._selectedSubpath.getCanvas();
430 if (!drawingCanvas){ 430 if (!drawingCanvas){
431 drawingCanvas = ViewUtils.getStageElement(); 431 drawingCanvas = this.application.ninja.currentDocument.model.documentRoot;
432 stageWorldMousePos = hitRec.calculateStageWorldPoint(); 432 stageWorldMousePos = hitRec.calculateStageWorldPoint();
433 stageWorldMousePos[0]+= snapManager.getStageWidth()*0.5; 433 stageWorldMousePos[0]+= snapManager.getStageWidth()*0.5;
434 stageWorldMousePos[1]+= snapManager.getStageHeight()*0.5; 434 stageWorldMousePos[1]+= snapManager.getStageHeight()*0.5;
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js
index 12b21a64..9e117837 100755
--- a/js/tools/RotateStage3DTool.js
+++ b/js/tools/RotateStage3DTool.js
@@ -85,6 +85,12 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
85 } 85 }
86 }, 86 },
87 87
88 captureSelectionChange: {
89 value: function(event){
90 this.eventManager.addEventListener("selectionDrawn", this, true);
91 }
92 },
93
88 captureSelectionDrawn: { 94 captureSelectionDrawn: {
89 value: function(event){ 95 value: function(event){
90 this._origin = null; 96 this._origin = null;
@@ -114,6 +120,11 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
114 this._origin = viewUtils.localToGlobal(eltCtr, stage); 120 this._origin = viewUtils.localToGlobal(eltCtr, stage);
115 this._setTransformOrigin(false); 121 this._setTransformOrigin(false);
116 this.DrawHandles(); 122 this.DrawHandles();
123
124 if(event)
125 {
126 this.eventManager.removeEventListener("selectionDrawn", this, true);
127 }
117 } 128 }
118 }, 129 },
119 130
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js
index 3549de1c..a752ad65 100755
--- a/js/tools/drawing-tool-base.js
+++ b/js/tools/drawing-tool-base.js
@@ -86,7 +86,7 @@ exports.DrawingToolBase = Montage.create(Component, {
86// return null; 86// return null;
87// } 87// }
88 if(downHitRec) { 88 if(downHitRec) {
89 hitRec = hitRec.convertToWorkingPlane(this.dragPlane); 89 hitRec = hitRec.convertToWorkingPlane(this.dragPlane || downHitRec.getPlane());
90 } else if ((hitRec.getType() !== hitRec.SNAP_TYPE_STAGE) && !hitRec.isSomeGridTypeSnap()) { 90 } else if ((hitRec.getType() !== hitRec.SNAP_TYPE_STAGE) && !hitRec.isSomeGridTypeSnap()) {
91 hitRec = hitRec.convertToWorkingPlane( snapManager.getDragPlane() ); 91 hitRec = hitRec.convertToWorkingPlane( snapManager.getDragPlane() );
92 } 92 }