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
This commit is contained in:
sasensi 2018-10-17 14:47:30 +02:00 committed by Jürg Lehni
parent d325fce909
commit bd70511b70
2 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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,