Fix zoom (#7)

This commit is contained in:
Chenlei Hu
2024-07-05 19:49:41 -04:00
committed by GitHub
parent 1933526a61
commit ce7d0a67cd

View File

@@ -7582,7 +7582,12 @@ LGraphNode.prototype.executeAction = function(action)
clientY_rel = e.clientY;
}
// Only set deltaX and deltaY if not already set.
// If deltaX and deltaY are already present, they are read-only.
// Setting them would result browser error => zoom in/out feature broken.
if (e.deltaX === undefined)
e.deltaX = clientX_rel - this.last_mouse_position[0];
if (e.deltaY === undefined)
e.deltaY = clientY_rel- this.last_mouse_position[1];
this.last_mouse_position[0] = clientX_rel;