(xOrVector: number | Vector2d, y?: number)
| 446 | shift(x: number, y: number): void; |
| 447 | shift(vector: Vector2d): void; |
| 448 | shift(xOrVector: number | Vector2d, y?: number) { |
| 449 | let _x: number; |
| 450 | let _y: number; |
| 451 | |
| 452 | if (xOrVector instanceof Vector2d) { |
| 453 | _x = xOrVector.x; |
| 454 | _y = xOrVector.y; |
| 455 | } else { |
| 456 | _x = xOrVector; |
| 457 | _y = y!; |
| 458 | } |
| 459 | |
| 460 | const deltaX = this.max.x - this.min.x; |
| 461 | const deltaY = this.max.y - this.min.y; |
| 462 | |
| 463 | this.min.x = _x; |
| 464 | this.max.x = _x + deltaX; |
| 465 | this.min.y = _y; |
| 466 | this.max.y = _y + deltaY; |
| 467 | } |
| 468 | |
| 469 | /** |
| 470 | * Creates a clone of this bounds. |
no outgoing calls