mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix Rectangle documentation
Add missing return values in Rectangle boolean operations. Closes #1399
This commit is contained in:
parent
97b87e3836
commit
c44f56d52f
1 changed files with 14 additions and 8 deletions
|
@ -772,6 +772,8 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
|
||||||
* Rectangle#contains(point)} returns `false` for that point.
|
* Rectangle#contains(point)} returns `false` for that point.
|
||||||
*
|
*
|
||||||
* @param {Point} point
|
* @param {Point} point
|
||||||
|
* @return {Rectangle} the smallest rectangle that contains both the
|
||||||
|
* original rectangle and the specified point
|
||||||
*/
|
*/
|
||||||
include: function(/* point */) {
|
include: function(/* point */) {
|
||||||
var point = Point.read(arguments);
|
var point = Point.read(arguments);
|
||||||
|
@ -783,17 +785,18 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expands the rectangle by the specified amount in horizontal and
|
* Returns a new rectangle expanded by the specified amount in horizontal
|
||||||
* vertical directions.
|
* and vertical directions.
|
||||||
*
|
*
|
||||||
* @name Rectangle#expand
|
* @name Rectangle#expand
|
||||||
* @function
|
* @function
|
||||||
* @param {Number|Size|Point} amount the amount to expand the rectangle in
|
* @param {Number|Size|Point} amount the amount to expand the rectangle in
|
||||||
* both directions
|
* both directions
|
||||||
|
* @return {Rectangle} the expanded rectangle
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Expands the rectangle by the specified amounts in horizontal and
|
* Returns a new rectangle expanded by the specified amounts in horizontal
|
||||||
* vertical directions.
|
* and vertical directions.
|
||||||
*
|
*
|
||||||
* @name Rectangle#expand
|
* @name Rectangle#expand
|
||||||
* @function
|
* @function
|
||||||
|
@ -801,6 +804,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
|
||||||
* direction
|
* direction
|
||||||
* @param {Number} ver the amount to expand the rectangle in vertical
|
* @param {Number} ver the amount to expand the rectangle in vertical
|
||||||
* direction
|
* direction
|
||||||
|
* @return {Rectangle} the expanded rectangle
|
||||||
*/
|
*/
|
||||||
expand: function(/* amount */) {
|
expand: function(/* amount */) {
|
||||||
var amount = Size.read(arguments),
|
var amount = Size.read(arguments),
|
||||||
|
@ -811,21 +815,23 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scales the rectangle by the specified amount from its center.
|
* Returns a new rectangle scaled by the specified amount from its center.
|
||||||
*
|
*
|
||||||
* @name Rectangle#scale
|
* @name Rectangle#scale
|
||||||
* @function
|
* @function
|
||||||
* @param {Number} amount
|
* @param {Number} amount
|
||||||
|
* @return {Rectangle} the scaled rectangle
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Scales the rectangle in horizontal direction by the specified `hor`
|
* Returns a new rectangle scaled in horizontal direction by the specified
|
||||||
* amount and in vertical direction by the specified `ver` amount from its
|
* `hor` amount and in vertical direction by the specified `ver` amount
|
||||||
* center.
|
* from its center.
|
||||||
*
|
*
|
||||||
* @name Rectangle#scale
|
* @name Rectangle#scale
|
||||||
* @function
|
* @function
|
||||||
* @param {Number} hor
|
* @param {Number} hor
|
||||||
* @param {Number} ver
|
* @param {Number} ver
|
||||||
|
* @return {Rectangle} the scaled rectangle
|
||||||
*/
|
*/
|
||||||
scale: function(hor, ver) {
|
scale: function(hor, ver) {
|
||||||
return this.expand(this.width * hor - this.width,
|
return this.expand(this.width * hor - this.width,
|
||||||
|
|
Loading…
Reference in a new issue