From 1393825bc2f17c1f585ccc23dd67ba457f052ebe Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 16 Mar 2013 13:15:21 +0100 Subject: [PATCH] Add object literal constructor docs to Rectangle. --- src/basic/Rectangle.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 835f5163..d4803d10 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -28,6 +28,25 @@ var Rectangle = this.Rectangle = Base.extend(/** @lends Rectangle# */{ * @param {Point} point the top-left point of the rectangle * @param {Size} size the size of the rectangle */ + /** + * Creates a Rectangle object. + * + * @name Rectangle#initialize + * @param {Object} properties An object literal containing properties to be + * set on the rectangle. + * + * @example // Create a rectangle between {x: 20, y: 20} and {x: 80, y:80} + * var rectangle = new Rectangle({ + * point: [20, 20], + * size: [60, 60] + * }); + * + * @example // Create a rectangle between {x: 20, y: 20} and {x: 80, y:80} + * var rectangle = new Rectangle({ + * from: [20, 20], + * to: [80, 80] + * }); + */ /** * Creates a rectangle object. *