()
| 295 | // Handle resize with debouncing |
| 296 | let resizeTimeout: number | null = null; |
| 297 | const handleResize = () => { |
| 298 | if (resizeTimeout) { |
| 299 | clearTimeout(resizeTimeout); |
| 300 | } |
| 301 | |
| 302 | resizeTimeout = window.setTimeout(() => { |
| 303 | if ( |
| 304 | !rendererRef.current || |
| 305 | !materialRef.current || |
| 306 | !containerRef.current |
| 307 | ) |
| 308 | return; |
| 309 | const newWidth = containerRef.current.clientWidth; |
| 310 | const newHeight = containerRef.current.clientHeight; |
| 311 | rendererRef.current.setSize(newWidth, newHeight); |
| 312 | materialRef.current.uniforms.uResolution.value.set(newWidth, newHeight); |
| 313 | }, 150); |
| 314 | }; |
| 315 | |
| 316 | window.addEventListener("resize", handleResize, { passive: true }); |
| 317 |
nothing calls this directly
no outgoing calls
no test coverage detected