From 8f8f7f9a36fb9abadea2a9f25aef0084946bebc9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 14:42:00 -0700 Subject: Removed special-casing for new template workflow. Instead, we will enforce a width and height on the body in order to do 3d. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index f4bfc12b..31e3e540 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -1617,11 +1617,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { if (x > y) { if (x > z) { plane[0] = 1; - if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { - plane[3] = stage.scrollWidth / 2.0; - } else { - plane[3] = this.getStageWidth() / 2.0; - } + plane[3] = this.getStageWidth() / 2.0; if (dir[0] > 0) plane[3] = -plane[3]; change = !drawUtils.drawYZ; drawUtils.drawXY = drawUtils.drawXZ = false; @@ -1639,11 +1635,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { else { if (y > z) { plane[1] = 1; - if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { - plane[3] = stage.scrollHeight / 2.0; - } else { - plane[3] = this.getStageHeight() / 2.0; - } + plane[3] = this.getStageHeight() / 2.0; if (dir[1] > 0) plane[3] = -plane[3]; change = !drawUtils.drawXZ; drawUtils.drawXY = drawUtils.drawYZ = false; -- cgit v1.2.3 From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/snap-manager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 5a36e367..2e8020d3 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -130,10 +130,10 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { bindSnap: { value: function() { - this.addEventListener("change@appModel.snap", this.toggleSnap, false); - this.addEventListener("change@appModel.snapGrid", this.toggleSnapGrid, false); - this.addEventListener("change@appModel.snapObjects", this.toggleSnapObjects, false); - this.addEventListener("change@appModel.snapAlign", this.toggleSnapAlign, false); + this.addPropertyChangeListener("appModel.snap", this.toggleSnap, false); + this.addPropertyChangeListener("appModel.snapGrid", this.toggleSnapGrid, false); + this.addPropertyChangeListener("appModel.snapObjects", this.toggleSnapObjects, false); + this.addPropertyChangeListener("appModel.snapAlign", this.toggleSnapAlign, false); } }, -- cgit v1.2.3 From b72c5f72ea5df4aa164350e1ba66fd1b4e23369d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 23:07:48 -0700 Subject: removing all stageDeps for drawing classes. Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/snap-manager.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 2e8020d3..7194524e 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -21,7 +21,6 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { /////////////////////////////////////////////////////////////////////// // Instance variables /////////////////////////////////////////////////////////////////////// - currentStage: { value: null, writable: true }, drawingCanvas: { value: null, writable: true}, // we keep a stack of working planes to facilitate working on other planes temporarily @@ -84,14 +83,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }}, getStageWidth : { value: function () { - return parseInt(this.currentStage.offsetWidth); + return parseInt(this.application.ninja.currentDocument.documentRoot.offsetWidth); }}, getStageHeight : { value: function () { - return parseInt(this.currentStage.offsetHeight); + return parseInt(this.application.ninja.currentDocument.documentRoot.offsetHeight); }}, - getStage : { value: function() { return this.currentStage; }}, + getStage : { value: function() { return this.application.ninja.currentDocument.documentRoot; }}, getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }}, getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }}, @@ -185,12 +184,6 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } }, - setCurrentStage: { - value: function(stage) { - this.currentStage = stage; - } - }, - snap : { value: function (xScreen, yScreen, snap3D, quadPt) { -- cgit v1.2.3 From 084bb924bc3c3a6ad1e2e21099399bba4d473fed Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:41:31 -0700 Subject: fixing some snapping bugs Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/snap-manager.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 7194524e..e22ac3ad 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -456,6 +456,13 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } }, + reload2DCache: { + value: function() { + this.clear2DCache(); + this.load2DCache(workingPlane); + } + }, + clear2DCache : { value : function() { // clear the 2D cache flags in the objects -- cgit v1.2.3 From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: 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. --- js/helper-classes/3D/snap-manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0f456e1e..d937e897 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -83,14 +83,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }}, getStageWidth : { value: function () { - return parseInt(this.application.ninja.currentDocument.documentRoot.offsetWidth); + return parseInt(this.application.ninja.currentDocument.model.documentRoot.offsetWidth); }}, getStageHeight : { value: function () { - return parseInt(this.application.ninja.currentDocument.documentRoot.offsetHeight); + return parseInt(this.application.ninja.currentDocument.model.documentRoot.offsetHeight); }}, - getStage : { value: function() { return this.application.ninja.currentDocument.documentRoot; }}, + getStage : { value: function() { return this.application.ninja.currentDocument.model.documentRoot; }}, getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }}, getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }}, -- cgit v1.2.3 From 1adc3b050728e393583f94eb2216db813d4a7293 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 11:20:42 -0700 Subject: Removed unused variables and methods in stage-deps, layout design, and snap-manager. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'js/helper-classes/3D/snap-manager.js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0f456e1e..f0f8dbe4 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -470,13 +470,6 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } }, - reload2DCache: { - value: function() { - this.clear2DCache(); - this.load2DCache(workingPlane); - } - }, - clear2DCache : { value : function() { // clear the 2D cache flags in the objects -- cgit v1.2.3