From 1806c9977b9e810f8a277f1bbdd127c1edef2335 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 25 Mar 2020 15:17:29 +0300 Subject: [PATCH] Which -> button property --- cvat-canvas/src/typescript/editHandler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cvat-canvas/src/typescript/editHandler.ts b/cvat-canvas/src/typescript/editHandler.ts index 07f366d6fb9..ba0ed7f6972 100644 --- a/cvat-canvas/src/typescript/editHandler.ts +++ b/cvat-canvas/src/typescript/editHandler.ts @@ -96,10 +96,10 @@ export class EditHandlerImpl implements EditHandler { let mouseY: number | null = null; this.canvas.on('mousedown.edit', (e: MouseEvent): void => { - if (e.which === 1) { + if (e.button === 0) { mouseX = e.clientX; mouseY = e.clientY; - } else if (e.which === 3 && this.editLine) { + } else if (e.button === 2 && this.editLine) { if (this.editData.state.shapeType === 'points' || this.editLine.attr('points').split(' ').length > 2 ) { @@ -110,7 +110,7 @@ export class EditHandlerImpl implements EditHandler { this.canvas.on('mouseup.edit', (e: MouseEvent): void => { const threshold = 10; // px - if (e.which === 1) { + if (e.button === 0) { if (Math.sqrt( // l2 distance < threshold ((mouseX - e.clientX) ** 2) + ((mouseY - e.clientY) ** 2),