mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 08:28:12 +08:00
Fix pointer offset from viewport position
This commit is contained in:
@@ -43,7 +43,7 @@ export function createInputManager(editor: Editor, dialog: DialogState, portfoli
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const listeners: { target: EventListenerTarget; eventName: EventName; action: (event: any) => void; options?: AddEventListenerOptions }[] = [
|
||||
{ target: window, eventName: "resize", action: () => updateBoundsOfViewports(editor, window.document.body) },
|
||||
{ target: window, eventName: "resize", action: () => updateBoundsOfViewports(editor) },
|
||||
{ target: window, eventName: "beforeunload", action: (e: BeforeUnloadEvent) => onBeforeUnload(e) },
|
||||
{ target: window, eventName: "keyup", action: (e: KeyboardEvent) => onKeyUp(e) },
|
||||
{ target: window, eventName: "keydown", action: (e: KeyboardEvent) => onKeyDown(e) },
|
||||
@@ -522,7 +522,7 @@ export function createInputManager(editor: Editor, dialog: DialogState, portfoli
|
||||
// Bind the event listeners
|
||||
bindListeners();
|
||||
// Resize on creation
|
||||
updateBoundsOfViewports(editor, window.document.body);
|
||||
updateBoundsOfViewports(editor);
|
||||
|
||||
// Return the destructor
|
||||
return unbindListeners;
|
||||
|
||||
Reference in New Issue
Block a user