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

Function rectContainsPoint

packages/react-devtools-timeline/src/view-base/geometry.js:118–121  ·  view source on GitHub ↗
({x, y}: Point, rect: Rect)

Source from the content-addressed store, hash-verified

116}
117
118export function rectContainsPoint({x, y}: Point, rect: Rect): boolean {
119 const [top, right, bottom, left] = rectToBox(rect);
120 return left <= x && x <= right && top <= y && y <= bottom;
121}
122
123/**
124 * Returns the smallest rectangle that contains all provided rects.

Callers 15

_handleMouseDownMethod · 0.90
_handleMouseMoveMethod · 0.90
_handleWheelMethod · 0.90
_handleMouseDownMethod · 0.90
_handleWheelShiftMethod · 0.90
_handleMouseDownMethod · 0.90
_handleMouseMoveMethod · 0.90
_handleMouseUpMethod · 0.90
_handleClickMethod · 0.90
_handleDoubleClickMethod · 0.90
_handleMouseDownMethod · 0.90

Calls 1

rectToBoxFunction · 0.85

Tested by

no test coverage detected