mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Merge pull request #109 from Lattay/bugfix_zoom
Fix use of non standard path attribute in zoom wheel event
This commit is contained in:
commit
ee51874048
@ -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
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user