MCPcopy
hub / github.com/tomkp/react-split-pane / updateSizeFromRect

Function updateSizeFromRect

src/components/SplitPane.tsx:241–251  ·  view source on GitHub ↗
(rect: { width: number; height: number })

Source from the content-addressed store, hash-verified

239 if (!container) return;
240
241 const updateSizeFromRect = (rect: { width: number; height: number }) => {
242 const rawSize = direction === 'horizontal' ? rect.width : rect.height;
243 // Round to nearest integer to prevent sub-pixel variations from causing
244 // resize feedback loops (fixes #873)
245 const size = Math.round(rawSize);
246 if (size > 0 && size !== lastObservedSizeRef.current) {
247 lastObservedSizeRef.current = size;
248 setContainerSize(size);
249 handleContainerSizeChange(size);
250 }
251 };
252
253 const resizeObserver = new ResizeObserver((entries) => {
254 const entry = entries[0];

Callers 1

SplitPaneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…