@@ -49,8 +49,6 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
4949 // Whenever a PaperScope is created, it automatically becomes the active
5050 // one.
5151 paper = this ;
52- this . view = null ;
53- this . views = [ ] ;
5452 this . project = null ;
5553 this . projects = [ ] ;
5654 this . tool = null ;
@@ -87,16 +85,13 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
8785 */
8886
8987 /**
90- * The active view of the active project.
88+ * The reference to the active project's view .
9189 * @name PaperScope#view
9290 * @type View
9391 */
94-
95- /**
96- * The list of view of the active project.
97- * @name PaperScope#views
98- * @type View[]
99- */
92+ getView : function ( ) {
93+ return this . project . view ;
94+ } ,
10095
10196 /**
10297 * The reference to the active tool.
@@ -159,19 +154,14 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
159154 // Make sure this is the active scope, so the created project and view
160155 // are automatically associated with it.
161156 paper = this ;
162- this . project = new Project ( ) ;
163- // Create a view for the canvas.
164- if ( canvas )
165- this . view = new View ( canvas ) ;
157+ this . project = new Project ( canvas ) ;
166158 } ,
167159
168160 clear : function ( ) {
169161 // Remove all projects, views and tools.
162+ // This also removes the installed event handlers.
170163 for ( var i = this . projects . length - 1 ; i >= 0 ; i -- )
171164 this . projects [ i ] . remove ( ) ;
172- // This also removes the installed event handlers.
173- for ( var i = this . views . length - 1 ; i >= 0 ; i -- )
174- this . views [ i ] . remove ( ) ;
175165 for ( var i = this . tools . length - 1 ; i >= 0 ; i -- )
176166 this . tools [ i ] . remove ( ) ;
177167 } ,
@@ -181,15 +171,6 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
181171 delete PaperScope . _scopes [ this . _id ] ;
182172 } ,
183173
184- _needsRedraw : function ( ) {
185- // Make sure we're not looping through the view list each time...
186- if ( ! this . _redrawNotified ) {
187- for ( var i = this . views . length - 1 ; i >= 0 ; i -- )
188- this . views [ i ] . _redrawNeeded = true ;
189- this . _redrawNotified = true ;
190- }
191- } ,
192-
193174 statics : /** @lends PaperScope */ {
194175 _scopes : { } ,
195176 _id : 0 ,
@@ -205,16 +186,6 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
205186 if ( typeof id === 'object' )
206187 id = id . getAttribute ( 'id' ) ;
207188 return this . _scopes [ id ] || null ;
208- } ,
209-
210- /**
211- * Iterates over all active scopes and calls the passed iterator
212- * function for each of them.
213- *
214- * @param iter the iterator function.
215- */
216- each : function ( iter ) {
217- Base . each ( this . _scopes , iter ) ;
218189 }
219190 }
220191} ) ;
0 commit comments