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

Function setSize

components/plasma.tsx:181–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179 }
180
181 const setSize = () => {
182 const rect = container.getBoundingClientRect();
183 const width = Math.max(1, Math.floor(rect.width));
184 const height = Math.max(1, Math.floor(rect.height));
185 renderer.setSize(width, height);
186 const res = program.uniforms.iResolution.value as Float32Array;
187 res[0] = gl.drawingBufferWidth;
188 res[1] = gl.drawingBufferHeight;
189 };
190
191 const ro = new ResizeObserver(setSize);
192 ro.observe(container);

Callers 1

PlasmaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected