MCPcopy Create free account
hub / github.com/editablejs/editable / getPointsFromRect

Function getPointsFromRect

packages/ui/src/hooks/use-pointer-in-transit.ts:33–41  ·  view source on GitHub ↗
(rect: DOMRect)

Source from the content-addressed store, hash-verified

31}
32
33function getPointsFromRect(rect: DOMRect) {
34 const { top, right, bottom, left } = rect
35 return [
36 { x: left, y: top },
37 { x: right, y: top },
38 { x: right, y: bottom },
39 { x: left, y: bottom },
40 ]
41}
42
43// Determine if a point is inside of a polygon.
44// Based on https://github.com/substack/point-in-polygon

Callers 1

usePointerInTransitFunction · 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…