Emit click events from one canvas to another

∥☆過路亽.° 提交于 2019-12-06 16:28:22

You need to use element.dispatchEvent.

You create a new event:

var evt2 = new Event('mousedown', { clientX: value, clientY: value2 });

You find value and value2 starting from the circle top and left and adding the values for x and y you find in canvas._offset

At that point you have an evt2 with the right values, and you can use

canvas.upperCanvasEl.dispatchEvent(evt2);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!