aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-17 23:07:48 -0700
committerValerio Virgillito2012-05-17 23:07:48 -0700
commitb72c5f72ea5df4aa164350e1ba66fd1b4e23369d (patch)
treecb5c1f5764e0487c4f77ea6e51fdbacb8666d790 /js/stage
parenteff40602cac6821f8272177c24b6bf3de399f8b1 (diff)
downloadninja-b72c5f72ea5df4aa164350e1ba66fd1b4e23369d.tar.gz
removing all stageDeps for drawing classes.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage-deps.js61
-rwxr-xr-xjs/stage/stage.reel/stage.html3
2 files changed, 8 insertions, 56 deletions
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index 1825eb06..17039438 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -11,8 +11,7 @@ var Montage = require("montage/core/core").Montage,
11 drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, 11 drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils,
12 ElementPlanes = require("js/helper-classes/3D/element-planes").ElementPlanes, 12 ElementPlanes = require("js/helper-classes/3D/element-planes").ElementPlanes,
13 MathUtilsClass = require("js/helper-classes/3D/math-utils").MathUtilsClass, 13 MathUtilsClass = require("js/helper-classes/3D/math-utils").MathUtilsClass,
14 VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, 14 VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
15 DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase;
16 15
17exports.StageDeps = Montage.create(Component, { 16exports.StageDeps = Montage.create(Component, {
18 viewUtils: { 17 viewUtils: {
@@ -27,24 +26,6 @@ exports.StageDeps = Montage.create(Component, {
27 value: drawUtils 26 value: drawUtils
28 }, 27 },
29 28
30 currentStage: {
31 value: null
32 },
33
34 _currentDocument: {
35 value: null
36 },
37
38 currentDocument: {
39 get: function() { return this._currentDocument; },
40 set: function(value) {
41 if(value) {
42 this._currentDocument = value;
43 this.currentStage = value.documentRoot;
44 }
45 }
46 },
47
48 _userContentLeft: { 29 _userContentLeft: {
49 value: null 30 value: null
50 }, 31 },
@@ -112,7 +93,9 @@ exports.StageDeps = Montage.create(Component, {
112 // bind the snap properties to the snap manager 93 // bind the snap properties to the snap manager
113 snapManager.bindSnap(); 94 snapManager.bindSnap();
114 95
115 96 drawUtils.viewUtils = viewUtils;
97 drawUtils.snapManager = snapManager;
98 drawUtils.ElementPlanes = ElementPlanes;
116 } 99 }
117 }, 100 },
118 101
@@ -121,22 +104,8 @@ exports.StageDeps = Montage.create(Component, {
121 104
122 workingPlane = [0,0,1,0]; 105 workingPlane = [0,0,1,0];
123 106
124 snapManager.setCurrentStage(this.currentStage); 107 snapManager._isCacheInvalid = true;
125 108 snapManager.setupDragPlaneFromPlane (workingPlane);
126 viewUtils.setCurrentDocument(this.currentDocument);
127 viewUtils.setRootElement(this.currentStage.parentNode);
128 viewUtils.setStageElement(this.currentStage);
129
130 drawUtils.viewUtils = viewUtils;
131 drawUtils.snapManager = snapManager;
132 drawUtils.ElementPlanes = ElementPlanes;
133
134 snapManager._isCacheInvalid=true;
135
136 snapManager.setupDragPlaneFromPlane ( workingPlane );
137
138 DrawingToolBase.stage = this.currentStage;
139 DrawingToolBase.stageComponent = this.stage;
140 109
141 drawUtils.initializeFromDocument(); 110 drawUtils.initializeFromDocument();
142 } 111 }
@@ -147,22 +116,8 @@ exports.StageDeps = Montage.create(Component, {
147 116
148 workingPlane = [0,0,1,0]; 117 workingPlane = [0,0,1,0];
149 118
150 snapManager.setCurrentStage(this.currentStage); 119 snapManager._isCacheInvalid = true;
151 120 snapManager.setupDragPlaneFromPlane (workingPlane);
152 viewUtils.setCurrentDocument(this.currentDocument);
153 viewUtils.setRootElement(this.currentStage.parentNode);
154 viewUtils.setStageElement(this.currentStage);
155
156 drawUtils.viewUtils = viewUtils;
157 drawUtils.snapManager = snapManager;
158 drawUtils.ElementPlanes = ElementPlanes;
159
160 snapManager._isCacheInvalid=true;
161
162 snapManager.setupDragPlaneFromPlane ( workingPlane );
163
164 DrawingToolBase.stage = this.currentStage;
165 DrawingToolBase.stageComponent = this.stage;
166 121
167 drawUtils.initializeFromDocument(); 122 drawUtils.initializeFromDocument();
168 } 123 }
diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html
index 88cd6149..30c3d231 100755
--- a/js/stage/stage.reel/stage.html
+++ b/js/stage/stage.reel/stage.html
@@ -22,9 +22,6 @@
22 "prototype": "js/stage/stage-deps", 22 "prototype": "js/stage/stage-deps",
23 "properties": { 23 "properties": {
24 "stage": {"@": "owner"} 24 "stage": {"@": "owner"}
25 },
26 "bindings": {
27 "currentDocument": {"<-": "@owner.activeDocument"}
28 } 25 }
29 }, 26 },
30 27