From 3763414c05ec5b608a05947ccb3a4922af3af949 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 20 Jul 2021 10:14:23 +0300 Subject: [PATCH] Hide bounding box after the first result was received from the server --- cvat-canvas/src/typescript/interactionHandler.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cvat-canvas/src/typescript/interactionHandler.ts b/cvat-canvas/src/typescript/interactionHandler.ts index c0cb91210f80..18dd02806100 100644 --- a/cvat-canvas/src/typescript/interactionHandler.ts +++ b/cvat-canvas/src/typescript/interactionHandler.ts @@ -140,6 +140,9 @@ export class InteractionHandlerImpl implements InteractionHandler { this.interactionShapes = this.interactionShapes.filter( (shape: SVG.Shape): boolean => shape !== self, ); + if (this.interactionData.startWithBox && this.interactionShapes.length === 1) { + this.interactionShapes[0].removeClass('cvat_canvas_hidden'); + } this.shapesWereUpdated = true; if (this.shouldRaiseEvent(_e.ctrlKey)) { this.onInteraction(this.prepareResult(), true, false); @@ -401,6 +404,9 @@ export class InteractionHandlerImpl implements InteractionHandler { if (interactionData.intermediateShape) { this.intermediateShape = interactionData.intermediateShape; this.updateIntermediateShape(); + if (this.interactionData.startWithBox) { + this.interactionShapes[0].addClass('cvat_canvas_hidden'); + } } else if (interactionData.enabled) { this.interactionData = interactionData; this.initInteraction();