diff options
author | Jon Reid | 2012-02-27 12:08:17 -0800 |
---|---|---|
committer | Jon Reid | 2012-02-27 12:08:17 -0800 |
commit | d55224f36da55e26c266a02efa6e58d4ecf1253e (patch) | |
tree | 36faa8ff93c0f7b925f5c0a7fb85b5d209da1f8e /js/stage/stage-deps.js | |
parent | ec5f81c6c0ccf865505ab82ebf9240c667f05c91 (diff) | |
parent | cf9e9b711ba3d77a2a0888f8ab763383f53a1619 (diff) | |
download | ninja-d55224f36da55e26c266a02efa6e58d4ecf1253e.tar.gz |
Merge remote-tracking branch 'ninja-jduran/Timeline' into Timeline-local
Diffstat (limited to 'js/stage/stage-deps.js')
-rwxr-xr-x | js/stage/stage-deps.js | 38 |
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 |