Skip to content

Commit

Permalink
Hide bounding box after the first result was received from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Sekachev committed Jul 20, 2021
1 parent 8276be1 commit 3763414
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cvat-canvas/src/typescript/interactionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3763414

Please sign in to comment.