MCPcopy Create free account
hub / github.com/react/react / rectToBox

Function rectToBox

packages/react-devtools-timeline/src/view-base/geometry.js:60–66  ·  view source on GitHub ↗
(rect: Rect)

Source from the content-addressed store, hash-verified

58}
59
60function rectToBox(rect: Rect): Box {
61 const top = rect.origin.y;
62 const right = rect.origin.x + rect.size.width;
63 const bottom = rect.origin.y + rect.size.height;
64 const left = rect.origin.x;
65 return [top, right, bottom, left];
66}
67
68function boxToRect(box: Box): Rect {
69 const [top, right, bottom, left] = box;

Callers 4

rectIntersectsRectFunction · 0.85
intersectionOfRectsFunction · 0.85
rectContainsPointFunction · 0.85
unionOfRectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected