mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c8e1a9c959
5 changed files with 40 additions and 9 deletions
|
@ -626,7 +626,24 @@ var Rectangle = this.Rectangle = Base.extend(/** @lends Rectangle# */{
|
|||
return Rectangle.create(x1, y1, x2 - x1, y2 - y1);
|
||||
},
|
||||
|
||||
// DOCS: Document #expand and #scale
|
||||
/**
|
||||
* Expands the rectangle by the specified amount in both horizontal and
|
||||
* vertical directions.
|
||||
*
|
||||
* @name Rectangle#expand
|
||||
* @function
|
||||
* @param {Number} amount
|
||||
*/
|
||||
/**
|
||||
* Expands the rectangle in horizontal direction by the specified
|
||||
* {@code hor} amount and in vertical direction by the specified {@code ver}
|
||||
* amount.
|
||||
*
|
||||
* @name Rectangle#expand^2
|
||||
* @function
|
||||
* @param {Number} hor
|
||||
* @param {Number} ver
|
||||
*/
|
||||
expand: function(hor, ver) {
|
||||
if (ver === undefined)
|
||||
ver = hor;
|
||||
|
@ -634,6 +651,23 @@ var Rectangle = this.Rectangle = Base.extend(/** @lends Rectangle# */{
|
|||
this.width + hor, this.height + ver);
|
||||
},
|
||||
|
||||
/**
|
||||
* Scales the rectangle by the specified amount from its center.
|
||||
*
|
||||
* @name Rectangle#scale
|
||||
* @function
|
||||
* @param {Number} amount
|
||||
*/
|
||||
/**
|
||||
* Scales the rectangle in horizontal direction by the specified
|
||||
* {@code hor} amount and in vertical direction by the specified {@code ver}
|
||||
* amount from its center.
|
||||
*
|
||||
* @name Rectangle#scale^2
|
||||
* @function
|
||||
* @param {Number} hor
|
||||
* @param {Number} ver
|
||||
*/
|
||||
scale: function(hor, ver) {
|
||||
return this.expand(this.width * hor - this.width,
|
||||
this.height * (ver === undefined ? hor : ver) - this.height);
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
// DOCS: write Color class documentation.
|
||||
/**
|
||||
* @name Color
|
||||
*
|
||||
|
|
|
@ -559,8 +559,6 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
|
|||
return this._parent;
|
||||
},
|
||||
|
||||
// DOCS: add comment to Item#children about not playing around with the
|
||||
// array directly - use addChild etc instead.
|
||||
/**
|
||||
* The children items contained within this item. Items that define a
|
||||
* {@link #name} can also be accessed by name.
|
||||
|
|
|
@ -76,14 +76,15 @@ var Layer = this.Layer = Group.extend(/** @lends Layer# */{
|
|||
: this._project.layers[this._index - 1] || null;
|
||||
},
|
||||
|
||||
// DOCS: improve Layer#activate() example.
|
||||
/**
|
||||
* Activates the layer.
|
||||
*
|
||||
* @example
|
||||
* var layer = new Layer();
|
||||
* layer.activate();
|
||||
* console.log(project.activeLayer == layer); // true
|
||||
* var firstLayer = project.activeLayer;
|
||||
* var secondLayer = new Layer();
|
||||
* console.log(project.activeLayer == secondLayer); // true
|
||||
* firstLayer.activate();
|
||||
* console.log(project.activeLayer == firstLayer); // true
|
||||
*/
|
||||
activate: function() {
|
||||
this._project.activeLayer = this;
|
||||
|
|
|
@ -982,7 +982,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
return null;
|
||||
},
|
||||
|
||||
// DOCS: improve Path#getPointAt documenation.
|
||||
/**
|
||||
* Get the point on the path at the given offset.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue