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

Function doRectsIntersect

packages/editor/src/utils/lines.ts:8–12  ·  view source on GitHub ↗
(rect: DOMRect, compareRect: DOMRect)

Source from the content-addressed store, hash-verified

6import { Editable } from '../plugin/editable'
7
8const doRectsIntersect = (rect: DOMRect, compareRect: DOMRect) => {
9 const middle = (compareRect.top + compareRect.bottom) / 2
10
11 return rect.top <= middle && rect.bottom >= middle
12}
13
14const areRangesSameLine = (editor: Editable, range1: Range, range2: Range) => {
15 const rect1 = Editable.toDOMRange(editor, range1).getBoundingClientRect()

Callers 1

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