Created
February 5, 2021 11:04
-
-
Save paramjeetdhiman/f07dbd48632e4ea624fd5dda84b95286 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let boom = { | |
| a: {x: 1200, y:230}, | |
| b: {x: 150, y: 250} | |
| }; | |
| (function (data) { | |
| var canvas = document.getElementById("toplevelGraphCanvas"); | |
| var rect = canvas.getBoundingClientRect(); | |
| var type = "mousedown"; | |
| canvas.dispatchEvent( | |
| new MouseEvent(type, { | |
| clientX: rect.left + data.a.x, | |
| clientY: rect.top + data.a.y, | |
| }) | |
| ); | |
| type="mousemove"; | |
| canvas.dispatchEvent( | |
| new MouseEvent(type, { | |
| clientX: rect.left + data.b.x, | |
| clientY: rect.top + data.b.y, | |
| }) | |
| ); | |
| type = "mouseup"; | |
| canvas.dispatchEvent( | |
| new MouseEvent(type, { | |
| clientX: rect.left + data.b.x, | |
| clientY: rect.top + data.b.y, | |
| }) | |
| ); | |
| })(boom); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment