Fix a bug due to non standard attribute.

This commit is contained in:
Theo Cavignac 2022-12-23 00:00:54 +01:00 committed by Théo Cavignac
parent 5d55425e83
commit 0e676184a9
1 changed files with 4 additions and 3 deletions

View File

@ -47,8 +47,9 @@ const ToolManager = (() => {
if (!EditorState.documentCreated || Dialogue.isOpen())
return;
const isHoveringMenuElement = !!mouseEvent.path.find(n=>n.id && n.id.includes("-menu"));
if(isHoveringMenuElement)return;
// Hovering a menu element
const path = mouseEvent.composedPath && mouseEvent.composedPath();
if (path && !!path.find(n=>n.id && n.id.includes("-menu"))) return;
let mousePos = Input.getCursorPosition(mouseEvent);
tools["zoom"].onMouseWheel(mousePos, mouseEvent.deltaY < 0 ? 'in' : 'out');
@ -164,4 +165,4 @@ const ToolManager = (() => {
return {
currentTool
}
})();
})();