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

Function toRelativePosition

packages/editor/src/plugin/editable.ts:1089–1094  ·  view source on GitHub ↗
(editor: Editor, x: number, y: number)

Source from the content-addressed store, hash-verified

1087 },
1088
1089 toRelativePosition(editor: Editor, x: number, y: number): [number, number] {
1090 const container = Editable.toDOMNode(editor, editor)
1091 const rootRect = container.getBoundingClientRect()
1092
1093 return [x - rootRect.left, y - rootRect.top]
1094 },
1095
1096 reverseRelativePosition(editor: Editor, x: number, y: number): [number, number] {
1097 const container = Editable.toDOMNode(editor, editor)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…