aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/snap-manager.js
diff options
context:
space:
mode:
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 {