1 goog.provide('goog.math.Box.size'); 2 goog.provide('goog.math.Size.scaleVec2'); 3 4 5 goog.require('goog.math.Box'); 6 goog.require('goog.math.Size'); 7 8 /** 9 * Return size of the box 10 * @return {goog.math.Size} Size of the box. 11 */ 12 goog.math.Box.prototype.size = function() { 13 return new goog.math.Size(this.right - this.left, this.bottom - this.top); 14 }; 15 16 17 /** 18 * Scales the size with by 2 dimensional vector 19 * @param {goog.math.Vec2} v Vector to scale. 20 * @return {goog.math.Size} This size object after scaling. 21 */ 22 goog.math.Size.prototype.scaleVec2 = function(v) { 23 this.width *= v.x; 24 this.height *= v.y; 25 return this; 26 }; 27