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

Function compareHeight

packages/editor/src/utils/selection.ts:196–204  ·  view source on GitHub ↗
(rect: DOMRect)

Source from the content-addressed store, hash-verified

194 * @param rect - The current rect
195 */
196 const compareHeight = (rect: DOMRect) => {
197 if (isRectInLine(rect, lineRect)) {
198 const newTop = lineRect.top < rect.top ? lineRect.top : rect.top
199 const newBottom = lineRect.bottom > rect.bottom ? lineRect.bottom : rect.bottom
200 lineRect.height = newBottom - newTop
201 lineRect.top = newTop
202 lineRect.bottom = newBottom
203 }
204 }
205
206 /**
207 * Recursively find the child nodes of the element and compare their rects

Callers 1

matchFunction · 0.85

Calls 1

isRectInLineFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…