(x: number, y: number)
| 255 | return this.isHoverInside; |
| 256 | } |
| 257 | setCoords(x: number, y: number) { |
| 258 | if (!this.container) return; |
| 259 | if (this.timer) window.clearTimeout(this.timer); |
| 260 | const rect = this.container.getBoundingClientRect(); |
| 261 | if (rect.width === 0 || rect.height === 0) return; |
| 262 | const nx = (x - rect.left) / rect.width; |
| 263 | const ny = (y - rect.top) / rect.height; |
| 264 | this.coords.set(nx * 2 - 1, -(ny * 2 - 1)); |
| 265 | this.mouseMoved = true; |
| 266 | this.timer = window.setTimeout(() => { |
| 267 | this.mouseMoved = false; |
| 268 | }, 100); |
| 269 | } |
| 270 | setNormalized(nx: number, ny: number) { |
| 271 | this.coords.set(nx, ny); |
| 272 | this.mouseMoved = true; |
no outgoing calls
no test coverage detected