aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js7
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js5
-rwxr-xr-xjs/helper-classes/3D/view-utils.js15
3 files changed, 11 insertions, 16 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 871b832d..75aa308c 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -126,7 +126,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
126 //initialize with current document 126 //initialize with current document
127 this._eltArray = []; 127 this._eltArray = [];
128 this._planesArray = []; 128 this._planesArray = [];
129 this.setDrawingSurfaceElement(stage.canvas); 129 this.setDrawingSurfaceElement(stage.gridCanvas);
130 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot); 130 this.setSourceSpaceElement( this.application.ninja.currentDocument.model.documentRoot);
131 this.setWorkingPlane( [0,0,1,0] ); 131 this.setWorkingPlane( [0,0,1,0] );
132 132
@@ -307,7 +307,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
307 } 307 }
308 308
309 if(!changed) { 309 if(!changed) {
310 stage.layout.draw();
311 this.drawWorkingPlane(); 310 this.drawWorkingPlane();
312 this.draw3DCompass(); 311 this.draw3DCompass();
313 } 312 }
@@ -631,8 +630,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
631 if (!this.isDrawingGrid()) return; 630 if (!this.isDrawingGrid()) return;
632 631
633 var saveContext = this.getDrawingSurfaceElement(); 632 var saveContext = this.getDrawingSurfaceElement();
634 //this.setDrawingSurfaceElement(window.stageManager.layoutCanvas); 633 this.setDrawingSurfaceElement(this.application.ninja.stage.gridCanvas);
635 this.setDrawingSurfaceElement(this.application.ninja.stage.layoutCanvas); 634 this.clear();
636 635
637 // 3 coordinate axes for the plane 636 // 3 coordinate axes for the plane
638 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]]; 637 var zAxis = [this._workingPlane[0], this._workingPlane[1], this._workingPlane[2]];
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 069c6022..4dcda24a 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -21,8 +21,7 @@ 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
26 // we keep a stack of working planes to facilitate working on other planes temporarily 25 // we keep a stack of working planes to facilitate working on other planes temporarily
27 _workingPlaneStack : { value: [], writable: true }, 26 _workingPlaneStack : { value: [], writable: true },
28 27
@@ -2124,7 +2123,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
2124 if (hitRec) 2123 if (hitRec)
2125 { 2124 {
2126 var saveContext = drawUtils.getDrawingSurfaceElement(); 2125 var saveContext = drawUtils.getDrawingSurfaceElement();
2127 drawUtils.setDrawingSurfaceElement(this.drawingCanvas); 2126 drawUtils.setDrawingSurfaceElement(this.application.ninja.stage.drawingCanvas);
2128 var context = drawUtils.getDrawingContext(); 2127 var context = drawUtils.getDrawingContext();
2129 if (context) 2128 if (context)
2130 { 2129 {
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js
index a3d09404..3c7ae6ff 100755
--- a/js/helper-classes/3D/view-utils.js
+++ b/js/helper-classes/3D/view-utils.js
@@ -195,7 +195,12 @@ exports.ViewUtils = Montage.create(Component, {
195 195
196 getPerspectiveDistFromElement: { 196 getPerspectiveDistFromElement: {
197 value: function( elt ) { 197 value: function( elt ) {
198 return ElementsMediator.getPerspectiveDist(elt); 198 var pDist = ElementsMediator.getPerspectiveDist(elt);
199 if(pDist === "none") {
200 return null;
201 } else {
202 return pDist;
203 }
199 } 204 }
200 }, 205 },
201 206
@@ -1320,14 +1325,6 @@ exports.ViewUtils = Montage.create(Component, {
1320 } 1325 }
1321 }, 1326 },
1322 1327
1323 getCurrentDocument:
1324 {
1325 value: function()
1326 {
1327 return snapManagerModule.SnapManager.application.ninja.currentDocument;
1328 }
1329 },
1330
1331 setStageZoom: { 1328 setStageZoom: {
1332 value:function( globalPt, zoomFactor ) { 1329 value:function( globalPt, zoomFactor ) {
1333 var localPt; 1330 var localPt;