From bdfb709352478a419dc3fa35cf1b6066fcace378 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 14 Jan 2022 17:03:00 +0300 Subject: [PATCH] Fixed test --- cvat-canvas/src/typescript/canvasView.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cvat-canvas/src/typescript/canvasView.ts b/cvat-canvas/src/typescript/canvasView.ts index 74395aea70c4..4da2e35ac6c7 100644 --- a/cvat-canvas/src/typescript/canvasView.ts +++ b/cvat-canvas/src/typescript/canvasView.ts @@ -2014,8 +2014,6 @@ export class CanvasViewImpl implements CanvasView, Listener { shapeSizeElement.rm(); shapeSizeElement = null; } - // disable internal resize events of SVG.js - window.dispatchEvent(new MouseEvent('mouseup')); this.mode = Mode.IDLE; }; @@ -2032,7 +2030,11 @@ export class CanvasViewImpl implements CanvasView, Listener { if (state.shapeType === 'rectangle') { shapeSizeElement = displayShapeSize(this.adoptedContent, this.adoptedText); } - (shape as any).on('remove.resize', resizeFinally); + (shape as any).on('remove.resize', () => { + // disable internal resize events of SVG.js + window.dispatchEvent(new MouseEvent('mouseup')); + resizeFinally(); + }); }) .on('resizing', (): void => { resized = true;