aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage-deps.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage-deps.js')
-rwxr-xr-xjs/stage/stage-deps.js38
1 files changed, 35 insertions, 3 deletions
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index d46e2b81..16f2c652 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -23,6 +23,10 @@ exports.StageDeps = Montage.create(Component, {
23 value: snapManager 23 value: snapManager
24 }, 24 },
25 25
26 drawUtils: {
27 value: drawUtils
28 },
29
26 currentStage: { 30 currentStage: {
27 value: null 31 value: null
28 }, 32 },
@@ -129,19 +133,47 @@ exports.StageDeps = Montage.create(Component, {
129 viewUtils.setRootElement(this.currentStage.parentNode); 133 viewUtils.setRootElement(this.currentStage.parentNode);
130 viewUtils.setStageElement(this.currentStage); 134 viewUtils.setStageElement(this.currentStage);
131 135
132 drawUtils.setDrawingSurfaceElement(this.stage.canvas);
133 drawUtils.setSourceSpaceElement( this.currentStage );
134 drawUtils.setWorkingPlane( workingPlane );
135 drawUtils.viewUtils = viewUtils; 136 drawUtils.viewUtils = viewUtils;
136 drawUtils.snapManager = snapManager; 137 drawUtils.snapManager = snapManager;
137 drawUtils.ElementPlanes = ElementPlanes; 138 drawUtils.ElementPlanes = ElementPlanes;
138 139
140 snapManager._isCacheInvalid=true;
141
142 snapManager.setupDragPlaneFromPlane ( workingPlane );
143
144 DrawingToolBase.stage = this.currentStage;
145 DrawingToolBase.stageComponent = this.stage;
146
147 drawUtils.initializeFromDocument();
148 }
149 },
150
151 reinitializeForSwitchDocument: {
152 value: function() {
153
154 workingPlane = Vector.create( [0,0,1,0] );
155
156 snapManager.setCurrentStage(this.currentStage);
157
158 viewUtils.setCurrentDocument(this.currentDocument);
159 viewUtils.setRootElement(this.currentStage.parentNode);
160 viewUtils.setStageElement(this.currentStage);
161
162 drawUtils.viewUtils = viewUtils;
163 drawUtils.snapManager = snapManager;
164 drawUtils.ElementPlanes = ElementPlanes;
165
166 snapManager._isCacheInvalid=true;
167
139 snapManager.setupDragPlaneFromPlane ( workingPlane ); 168 snapManager.setupDragPlaneFromPlane ( workingPlane );
140 169
141 DrawingToolBase.stage = this.currentStage; 170 DrawingToolBase.stage = this.currentStage;
142 DrawingToolBase.stageComponent = this.stage; 171 DrawingToolBase.stageComponent = this.stage;
143 172
173 drawUtils.initializeFromDocument();
144 } 174 }
145 } 175 }
146 176
177
178
147}); \ No newline at end of file 179}); \ No newline at end of file