From bd70511b70108ea7d07fae49002fbeb0e7bcf2b4 Mon Sep 17 00:00:00 2001 From: sasensi Date: Wed, 17 Oct 2018 14:47:30 +0200 Subject: [PATCH] Add documentation for PaperScope#setup(size) Documentation did not mention that a size can be passed as argument to PaperScope#setup() and Project#initialize() for usage of paper.js in web workers. Closes #1412 --- src/core/PaperScope.js | 7 ++++--- src/item/Project.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index 6496af4a..e60b834b 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -249,9 +249,10 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ * Sets up an empty project for us. If a canvas is provided, it also creates * a {@link View} for it, both linked to this scope. * - * @param {HTMLCanvasElement|String} element the HTML canvas element this - * scope should be associated with, or an ID string by which to find the - * element. + * @param {HTMLCanvasElement|String|Size} element the HTML canvas element + * this scope should be associated with, or an ID string by which to find + * the element, or the size of the canvas to be created for usage in a web + * worker. */ setup: function(element) { // Make sure this is the active scope, so the created project and view diff --git a/src/item/Project.js b/src/item/Project.js index 53b01108..8a7ad5c4 100644 --- a/src/item/Project.js +++ b/src/item/Project.js @@ -44,9 +44,10 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ * Note that when working with PaperScript, a project is automatically * created for us and the {@link PaperScope#project} variable points to it. * - * @param {HTMLCanvasElement|String} element the HTML canvas element that - * should be used as the element for the view, or an ID string by which to - * find the element. + * @param {HTMLCanvasElement|String|Size} element the HTML canvas element + * that should be used as the element for the view, or an ID string by which + * to find the element, or the size of the canvas to be created for usage in + * a web worker. */ initialize: function Project(element) { // Activate straight away by passing true to PaperScopeItem constructor,