MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / handleResize

Function handleResize

components/light-pillar.tsx:297–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected