MCPcopy
hub / github.com/DavidHDev/react-bits / setSize

Function setSize

src/ts-tailwind/Backgrounds/Waves/Waves.tsx:216–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214 ctxRef.current = canvas.getContext('2d');
215
216 function setSize() {
217 if (!container || !canvas) return;
218 const rect = container.getBoundingClientRect();
219 boundingRef.current = {
220 width: rect.width,
221 height: rect.height,
222 left: rect.left,
223 top: rect.top
224 };
225 canvas.width = rect.width;
226 canvas.height = rect.height;
227 }
228
229 function setLines() {
230 const { width, height } = boundingRef.current;

Callers 4

onResizeFunction · 0.70
WavesFunction · 0.70
useMeasureFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected