aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/snap-manager.js
diff options
context:
space:
mode:
authorAnanya Sen2012-06-04 10:43:29 -0700
committerAnanya Sen2012-06-04 10:43:29 -0700
commit6fb29883329c9c42a8b406128b92c0e6323a47be (patch)
tree07f46e88bccf9cdb7d4e6818e1b646b0d19f05b9 /js/helper-classes/3D/snap-manager.js
parentcf097ec69e35c07ecae5a105ed5eeb78291c9ac2 (diff)
parentc1ec69879028220b0c3f11ad6e24035bf527802c (diff)
downloadninja-6fb29883329c9c42a8b406128b92c0e6323a47be.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts: js/ninja.reel/ninja.html Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/helper-classes/3D/snap-manager.js')
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 069c6022..e3756f32 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -21,8 +21,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
21 /////////////////////////////////////////////////////////////////////// 21 ///////////////////////////////////////////////////////////////////////
22 // Instance variables 22 // Instance variables
23 /////////////////////////////////////////////////////////////////////// 23 ///////////////////////////////////////////////////////////////////////
24 drawingCanvas: { value: null, writable: true}, 24
25 25 currentStage: { value: null },
26
26 // we keep a stack of working planes to facilitate working on other planes temporarily 27 // we keep a stack of working planes to facilitate working on other planes temporarily
27 _workingPlaneStack : { value: [], writable: true }, 28 _workingPlaneStack : { value: [], writable: true },
28 29
@@ -83,14 +84,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
83 popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }}, 84 popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }},
84 85
85 getStageWidth : { value: function () { 86 getStageWidth : { value: function () {
86 return parseInt(this.application.ninja.currentDocument.model.documentRoot.offsetWidth); 87 return parseInt(this.currentStage.offsetWidth);
87 }}, 88 }},
88 89
89 getStageHeight : { value: function () { 90 getStageHeight : { value: function () {
90 return parseInt(this.application.ninja.currentDocument.model.documentRoot.offsetHeight); 91 return parseInt(this.currentStage.offsetHeight);
91 }}, 92 }},
92 93
93 getStage : { value: function() { return this.application.ninja.currentDocument.model.documentRoot; }}, 94 getStage : { value: function() { return this.currentStage; }},
94 95
95 getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }}, 96 getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }},
96 getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }}, 97 getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }},
@@ -2124,7 +2125,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
2124 if (hitRec) 2125 if (hitRec)
2125 { 2126 {
2126 var saveContext = drawUtils.getDrawingSurfaceElement(); 2127 var saveContext = drawUtils.getDrawingSurfaceElement();
2127 drawUtils.setDrawingSurfaceElement(this.drawingCanvas); 2128 drawUtils.setDrawingSurfaceElement(this.application.ninja.stage.drawingCanvas);
2128 var context = drawUtils.getDrawingContext(); 2129 var context = drawUtils.getDrawingContext();
2129 if (context) 2130 if (context)
2130 { 2131 {