From 0df65796d02922a6c8f5c93cfe0cff84c27ce7c9 Mon Sep 17 00:00:00 2001 From: klakhov Date: Mon, 25 Oct 2021 19:35:03 +0300 Subject: [PATCH 1/2] added event repeat check --- cvat-canvas/src/typescript/interactionHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat-canvas/src/typescript/interactionHandler.ts b/cvat-canvas/src/typescript/interactionHandler.ts index 37cedd981d64..101d0c00c9ff 100644 --- a/cvat-canvas/src/typescript/interactionHandler.ts +++ b/cvat-canvas/src/typescript/interactionHandler.ts @@ -450,7 +450,7 @@ export class InteractionHandlerImpl implements InteractionHandler { }); window.addEventListener('keydown', (e: KeyboardEvent): void => { - if (this.interactionData.enabled && e.keyCode === 17) { + if (!e.repeat && this.interactionData.enabled && e.keyCode === 17) { if (this.interactionData.onChangeToolsBlockerState && !this.thresholdWasModified) { this.interactionData.onChangeToolsBlockerState('keydown'); } From 5ebeaba2a646c6572254627a7f04198c168b8a01 Mon Sep 17 00:00:00 2001 From: Kirill Lakhov Date: Tue, 26 Oct 2021 12:20:16 +0300 Subject: [PATCH 2/2] fix eslint errors --- cvat-canvas/src/typescript/interactionHandler.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cvat-canvas/src/typescript/interactionHandler.ts b/cvat-canvas/src/typescript/interactionHandler.ts index 101d0c00c9ff..197b5f000b2c 100644 --- a/cvat-canvas/src/typescript/interactionHandler.ts +++ b/cvat-canvas/src/typescript/interactionHandler.ts @@ -22,19 +22,33 @@ export interface InteractionHandler { export class InteractionHandlerImpl implements InteractionHandler { private onInteraction: (shapes: InteractionResult[] | null, shapesUpdated?: boolean, isDone?: boolean) => void; + private configuration: Configuration; + private geometry: Geometry; + private canvas: SVG.Container; + private interactionData: InteractionData; + private cursorPosition: { x: number; y: number }; + private shapesWereUpdated: boolean; + private interactionShapes: SVG.Shape[]; + private currentInteractionShape: SVG.Shape | null; + private crosshair: Crosshair; + private threshold: SVG.Rect | null; + private thresholdRectSize: number; + private intermediateShape: PropType; + private drawnIntermediateShape: SVG.Shape; + private thresholdWasModified: boolean; private prepareResult(): InteractionResult[] { @@ -310,6 +324,7 @@ export class InteractionHandlerImpl implements InteractionHandler { } private selectize(value: boolean, shape: SVG.Element, erroredShape = false): void { + // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; if (value) {