Skip to content

Commit

Permalink
Which -> button property
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Mar 25, 2020
1 parent 71d0bb5 commit 1806c99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cvat-canvas/src/typescript/editHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand All @@ -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),
Expand Down

0 comments on commit 1806c99

Please sign in to comment.