mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 15:17:12 -05:00
fix drag/drop breaking when editor is zoomed (#3916)
This commit is contained in:
parent
4f6dcb0b5b
commit
8b2a64852b
1 changed files with 4 additions and 3 deletions
|
|
@ -1053,9 +1053,10 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
|||
if ret:
|
||||
self.doPaste(html, internal, extended)
|
||||
|
||||
self.web.evalWithCallback(
|
||||
f"focusIfField({cursor_pos.x()}, {cursor_pos.y()});", pasteIfField
|
||||
)
|
||||
zoom = self.web.zoomFactor()
|
||||
x, y = int(cursor_pos.x() / zoom), int(cursor_pos.y() / zoom)
|
||||
|
||||
self.web.evalWithCallback(f"focusIfField({x}, {y});", pasteIfField)
|
||||
|
||||
def onPaste(self) -> None:
|
||||
self.web.onPaste()
|
||||
|
|
|
|||
Loading…
Reference in a new issue