Skip to content

Commit

Permalink
fix: remove custom coordsAtPos method, fix #583
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Jun 1, 2021
1 parent 1838d09 commit 485fb8c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 76 deletions.
72 changes: 0 additions & 72 deletions packages/core/src/helpers/coordsAtPos.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/core/src/helpers/posToDOMRect.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { EditorView } from 'prosemirror-view'
import coordsAtPos from './coordsAtPos'

export default function posToDOMRect(view: EditorView, from: number, to: number): DOMRect {
const start = coordsAtPos(view, from)
const end = coordsAtPos(view, to, true)
const start = view.coordsAtPos(from)
const end = view.coordsAtPos(to, -1)
const top = Math.min(start.top, end.top)
const bottom = Math.max(start.bottom, end.bottom)
const left = Math.min(start.left, end.left)
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export { default as markPasteRule } from './pasteRules/markPasteRule'
export { default as callOrReturn } from './utilities/callOrReturn'
export { default as mergeAttributes } from './utilities/mergeAttributes'

export { default as coordsAtPos } from './helpers/coordsAtPos'
export { default as getExtensionField } from './helpers/getExtensionField'
export { default as findChildren } from './helpers/findChildren'
export { default as findChildrenInRange } from './helpers/findChildrenInRange'
Expand Down

0 comments on commit 485fb8c

Please sign in to comment.