diff --git a/lib/canvas_editor/events.js b/lib/canvas_editor/events.js index e1bf8b27..daa4df4a 100644 --- a/lib/canvas_editor/events.js +++ b/lib/canvas_editor/events.js @@ -30,14 +30,14 @@ function addPointerListeners(canvasElement, drawArea, JavaEditorArea) { canvasElement.addEventListener('pointerdown', (ev) => { if (pointerDownId === -1) { pointerDownId = ev.pointerId; - fireMouseEvent(JavaEditorArea.MOUSE_EVENT_PRESSED, ev, ev.detail); + fireMouseEvent(JavaEditorArea.MOUSE_EVENT_PRESSED, ev); } }); function handlePointerUp(ev) { if (pointerDownId === ev.pointerId) { pointerDownId = -1; - fireMouseEvent(JavaEditorArea.MOUSE_EVENT_RELEASED, ev, ev.detail); + fireMouseEvent(JavaEditorArea.MOUSE_EVENT_RELEASED, ev); } } // Listen on document to capture mouse release outside the canvas. @@ -47,9 +47,11 @@ function addPointerListeners(canvasElement, drawArea, JavaEditorArea) { fireMouseEvent(JavaEditorArea.MOUSE_EVENT_CLICKED, ev, ev.detail); }); canvasElement.addEventListener('pointerenter', (ev) => { + // event.detail on pointerenter doesn't include the click count fireMouseEvent(JavaEditorArea.MOUSE_EVENT_ENTERED, ev); }); canvasElement.addEventListener('pointerleave', (ev) => { + // event.detail on pointerenter doesn't include the click count fireMouseEvent(JavaEditorArea.MOUSE_EVENT_EXITED, ev); }); canvasElement.addEventListener('pointermove', (ev) => {