* @function Bounds.prototype.add * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。 * @example * var bounds1 = new Bounds(-50,-50,40,40); * //bounds2 是新的 bounds * var bounds2 = bounds.add(20,10); * @param {number} x - 坐标点的 x 坐标。 * @param {number} y - 坐标点的 y 坐标。
(x, y)
| 298 | * @returns {Bounds} 新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。 |
| 299 | */ |
| 300 | add(x, y) { |
| 301 | if ((x == null) || (y == null)) { |
| 302 | throw new TypeError('Bounds.add cannot receive null values'); |
| 303 | } |
| 304 | return new Bounds(this.left + x, this.bottom + y, |
| 305 | this.right + x, this.top + y); |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * @function Bounds.prototype.extend |
no outgoing calls
no test coverage detected