From 272356b41c196b0cf93519216b516287347c0122 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 14 Jan 2022 16:15:14 +0300 Subject: [PATCH 1/3] Fixed issue: Uncaught TypeError: this.el.node.getScreenCTM() is null in Firefox --- cvat-canvas/src/typescript/canvasView.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cvat-canvas/src/typescript/canvasView.ts b/cvat-canvas/src/typescript/canvasView.ts index 1d9cf9e8b870..74395aea70c4 100644 --- a/cvat-canvas/src/typescript/canvasView.ts +++ b/cvat-canvas/src/typescript/canvasView.ts @@ -1947,6 +1947,8 @@ export class CanvasViewImpl implements CanvasView, Listener { hideText(); (shape as any).on('remove.drag', (): void => { this.mode = Mode.IDLE; + // disable internal drag events of SVG.js + window.dispatchEvent(new MouseEvent('mouseup')); }); }) .on('dragend', (e: CustomEvent): void => { @@ -2012,6 +2014,8 @@ 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; }; From 515b45e0a71ac7389095694e2bcf504fd554930d Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 14 Jan 2022 16:18:22 +0300 Subject: [PATCH 2/3] Updated version and changelog --- CHANGELOG.md | 1 + cvat-canvas/package-lock.json | 4 ++-- cvat-canvas/package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4fb4ad17ac..9f8eb6cfd39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Order in an annotation file() - Fixed task data upload progressbar () - Email in org invitations is case sensitive () +- Uncaught TypeError: this.el.node.getScreenCTM() is null in Firefox () - Bug: canvas is busy when start playing, start resizing a shape and do not release the mouse cursor () - Fixed tus upload error over https () diff --git a/cvat-canvas/package-lock.json b/cvat-canvas/package-lock.json index 228a91101f06..2b4aaa0da08e 100644 --- a/cvat-canvas/package-lock.json +++ b/cvat-canvas/package-lock.json @@ -1,12 +1,12 @@ { "name": "cvat-canvas", - "version": "2.12.1", + "version": "2.12.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cvat-canvas", - "version": "2.12.1", + "version": "2.12.2", "license": "MIT", "dependencies": { "@types/polylabel": "^1.0.5", diff --git a/cvat-canvas/package.json b/cvat-canvas/package.json index 7e4ce64f46f1..c348438b1034 100644 --- a/cvat-canvas/package.json +++ b/cvat-canvas/package.json @@ -1,6 +1,6 @@ { "name": "cvat-canvas", - "version": "2.12.1", + "version": "2.12.2", "description": "Part of Computer Vision Annotation Tool which presents its canvas library", "main": "src/canvas.ts", "scripts": { From bdfb709352478a419dc3fa35cf1b6066fcace378 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 14 Jan 2022 17:03:00 +0300 Subject: [PATCH 3/3] 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;