mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
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:
parent
d325fce909
commit
bd70511b70
2 changed files with 8 additions and 6 deletions
|
@ -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
|
* 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.
|
* a {@link View} for it, both linked to this scope.
|
||||||
*
|
*
|
||||||
* @param {HTMLCanvasElement|String} element the HTML canvas element this
|
* @param {HTMLCanvasElement|String|Size} element the HTML canvas element
|
||||||
* scope should be associated with, or an ID string by which to find the
|
* this scope should be associated with, or an ID string by which to find
|
||||||
* element.
|
* the element, or the size of the canvas to be created for usage in a web
|
||||||
|
* worker.
|
||||||
*/
|
*/
|
||||||
setup: function(element) {
|
setup: function(element) {
|
||||||
// Make sure this is the active scope, so the created project and view
|
// Make sure this is the active scope, so the created project and view
|
||||||
|
|
|
@ -44,9 +44,10 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
|
||||||
* Note that when working with PaperScript, a project is automatically
|
* Note that when working with PaperScript, a project is automatically
|
||||||
* created for us and the {@link PaperScope#project} variable points to it.
|
* created for us and the {@link PaperScope#project} variable points to it.
|
||||||
*
|
*
|
||||||
* @param {HTMLCanvasElement|String} element the HTML canvas element that
|
* @param {HTMLCanvasElement|String|Size} element the HTML canvas element
|
||||||
* should be used as the element for the view, or an ID string by which to
|
* that should be used as the element for the view, or an ID string by which
|
||||||
* find the element.
|
* to find the element, or the size of the canvas to be created for usage in
|
||||||
|
* a web worker.
|
||||||
*/
|
*/
|
||||||
initialize: function Project(element) {
|
initialize: function Project(element) {
|
||||||
// Activate straight away by passing true to PaperScopeItem constructor,
|
// Activate straight away by passing true to PaperScopeItem constructor,
|
||||||
|
|
Loading…
Reference in a new issue