* Changes the position and/or size of the shade. * @param {number} x The new position in the horizontal direction. * @param {number} y The new position in the vertical direction. * @param {number} [width] The new width. * @param {number} [height] The new height. * @returns {CropperSha
(x: number, y: number, width: number = this.width, height: number = this.height)
| 149 | * @returns {CropperShade} Returns `this` for chaining. |
| 150 | */ |
| 151 | $change(x: number, y: number, width: number = this.width, height: number = this.height): this { |
| 152 | if ( |
| 153 | !isNumber(x) |
| 154 | || !isNumber(y) |
| 155 | || !isNumber(width) |
| 156 | || !isNumber(height) |
| 157 | || (x === this.x && y === this.y && width === this.width && height === this.height) |
| 158 | ) { |
| 159 | return this; |
| 160 | } |
| 161 | |
| 162 | if (this.hidden) { |
| 163 | this.hidden = false; |
| 164 | } |
| 165 | |
| 166 | this.x = x; |
| 167 | this.y = y; |
| 168 | this.width = width; |
| 169 | this.height = height; |
| 170 | |
| 171 | return this.$render(); |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * Resets the shade to its initial position and size. |
no test coverage detected