Merge remote-tracking branch 'origin/master'

This commit is contained in:
Jürg Lehni 2011-11-12 23:57:39 +01:00
commit c8e1a9c959
5 changed files with 40 additions and 9 deletions

View file

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

View file

@ -14,7 +14,6 @@
* All rights reserved.
*/
// DOCS: write Color class documentation.
/**
* @name Color
*

View file

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

View file

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

View file

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