Index: third_party/google_input_tools/third_party/closure_library/closure/goog/math/rect.js |
diff --git a/third_party/google_input_tools/third_party/closure_library/closure/goog/math/rect.js b/third_party/google_input_tools/third_party/closure_library/closure/goog/math/rect.js |
index 008918bd7f054b96c4306372d6baf4f64f8dfc10..0a92b2e0f636038927efe40f6440e286b8d8d263 100644 |
--- a/third_party/google_input_tools/third_party/closure_library/closure/goog/math/rect.js |
+++ b/third_party/google_input_tools/third_party/closure_library/closure/goog/math/rect.js |
@@ -30,6 +30,7 @@ goog.require('goog.math.Size'); |
* @param {number} y Top. |
* @param {number} w Width. |
* @param {number} h Height. |
+ * @struct |
* @constructor |
*/ |
goog.math.Rect = function(x, y, w, h) { |
@@ -71,6 +72,18 @@ goog.math.Rect.prototype.toBox = function() { |
/** |
+ * Creates a new Rect object with the position and size given. |
+ * @param {!goog.math.Coordinate} position The top-left coordinate of the Rect |
+ * @param {!goog.math.Size} size The size of the Rect |
+ * @return {!goog.math.Rect} A new Rect initialized with the given position and |
+ * size. |
+ */ |
+goog.math.Rect.createFromPositionAndSize = function(position, size) { |
+ return new goog.math.Rect(position.x, position.y, size.width, size.height); |
+}; |
+ |
+ |
+/** |
* Creates a new Rect object with the same position and dimensions as a given |
* Box. Note that this is only the inverse of toBox if left/top are defined. |
* @param {goog.math.Box} box A box. |
@@ -201,7 +214,7 @@ goog.math.Rect.prototype.intersects = function(rect) { |
* rectangle after the second has been subtracted. |
* @param {goog.math.Rect} a A Rectangle. |
* @param {goog.math.Rect} b A Rectangle. |
- * @return {!Array.<!goog.math.Rect>} An array with 0 to 4 rectangles which |
+ * @return {!Array<!goog.math.Rect>} An array with 0 to 4 rectangles which |
* together define the difference area of rectangle a minus rectangle b. |
*/ |
goog.math.Rect.difference = function(a, b) { |
@@ -251,7 +264,7 @@ goog.math.Rect.difference = function(a, b) { |
* return value is an array of 0 to 4 rectangles defining the remaining regions |
* of this rectangle after the other has been subtracted. |
* @param {goog.math.Rect} rect A Rectangle. |
- * @return {!Array.<!goog.math.Rect>} An array with 0 to 4 rectangles which |
+ * @return {!Array<!goog.math.Rect>} An array with 0 to 4 rectangles which |
* together define the difference area of rectangle a minus rectangle b. |
*/ |
goog.math.Rect.prototype.difference = function(rect) { |