Skip to content

Commit 0485851

Browse files
committed
Add JSDoc comments for additional PaperScope methods
1 parent b081fd7 commit 0485851

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/core/PaperScope.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,19 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
265265
return this;
266266
},
267267

268+
/**
269+
* Returns a valid HTML canvas you can use. Internally, this may reuse an existing canvas.
270+
*
271+
* This either accepts width and height as two arguments, or you can pass in an object with "width" and "height" properties.
272+
*
273+
* @param {Number|Object} width
274+
* @param {Number} height
275+
*
276+
* @option width {Number}
277+
* @option height {Number}
278+
*
279+
* @returns {HTMLCanvasElement}
280+
*/
268281
createCanvas: function(width, height) {
269282
return CanvasProvider.getCanvas(width, height);
270283
},
@@ -277,9 +290,11 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
277290
paper = this;
278291
},
279292

293+
/**
294+
* Remove all projects, views and tools.
295+
* This also removes the installed event handlers.
296+
*/
280297
clear: function() {
281-
// Remove all projects, views and tools.
282-
// This also removes the installed event handlers.
283298
var projects = this.projects,
284299
tools = this.tools;
285300
for (var i = projects.length - 1; i >= 0; i--)

0 commit comments

Comments
 (0)