From 68603ec4cf74b834fc80d6238d0838c3bdd8284a Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 16 Nov 2020 17:28:06 +0300 Subject: [PATCH 1/2] Reset zoom option works in tag annotation mode --- .../standard-workspace/canvas-wrapper.tsx | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx index d760411ab66a..acc697ae0990 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/canvas-wrapper.tsx @@ -10,7 +10,9 @@ import Icon from 'antd/lib/icon'; import Layout from 'antd/lib/layout/layout'; import Slider, { SliderValue } from 'antd/lib/slider'; -import { ColorBy, GridColor, ObjectType, ContextMenuType, Workspace, ShapeType } from 'reducers/interfaces'; +import { + ColorBy, GridColor, ObjectType, ContextMenuType, Workspace, ShapeType, +} from 'reducers/interfaces'; import { LogType } from 'cvat-logger'; import { Canvas } from 'cvat-canvas-wrapper'; import getCore from 'cvat-core-wrapper'; @@ -217,10 +219,7 @@ export default class CanvasWrapperComponent extends React.PureComponent { this.updateCanvas(); } - if ( - prevProps.frame !== frameData.number && - ((resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) || workspace === Workspace.TAG_ANNOTATION) - ) { + if (prevProps.frame !== frameData.number && resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) { canvasInstance.html().addEventListener( 'canvas.setup', () => { @@ -304,7 +303,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { } private onCanvasShapeDrawn = (event: any): void => { - const { jobInstance, activeLabelID, activeObjectType, frame, onShapeDrawn, onCreateAnnotations } = this.props; + const { + jobInstance, activeLabelID, activeObjectType, frame, onShapeDrawn, onCreateAnnotations, + } = this.props; if (!event.detail.continue) { onShapeDrawn(); @@ -327,7 +328,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { }; private onCanvasObjectsMerged = (event: any): void => { - const { jobInstance, frame, onMergeAnnotations, onMergeObjects } = this.props; + const { + jobInstance, frame, onMergeAnnotations, onMergeObjects, + } = this.props; onMergeObjects(false); @@ -340,7 +343,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { }; private onCanvasObjectsGroupped = (event: any): void => { - const { jobInstance, frame, onGroupAnnotations, onGroupObjects } = this.props; + const { + jobInstance, frame, onGroupAnnotations, onGroupObjects, + } = this.props; onGroupObjects(false); @@ -349,7 +354,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { }; private onCanvasTrackSplitted = (event: any): void => { - const { jobInstance, frame, onSplitAnnotations, onSplitTrack } = this.props; + const { + jobInstance, frame, onSplitAnnotations, onSplitTrack, + } = this.props; onSplitTrack(false); @@ -429,7 +436,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { }; private onCanvasCursorMoved = async (event: any): Promise => { - const { jobInstance, activatedStateID, workspace, onActivateObject } = this.props; + const { + jobInstance, activatedStateID, workspace, onActivateObject, + } = this.props; if (workspace !== Workspace.STANDARD) { return; @@ -560,7 +569,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { } private updateShapesView(): void { - const { annotations, opacity, colorBy, outlined, outlineColor } = this.props; + const { + annotations, opacity, colorBy, outlined, outlineColor, + } = this.props; for (const state of annotations) { let shapeColor = ''; @@ -588,7 +599,9 @@ export default class CanvasWrapperComponent extends React.PureComponent { } private updateCanvas(): void { - const { curZLayer, annotations, frameData, canvasInstance } = this.props; + const { + curZLayer, annotations, frameData, canvasInstance, + } = this.props; if (frameData !== null) { canvasInstance.setup( From cf9e287e9d0e0e18f963f68e5bd439e9540bc959 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 16 Nov 2020 17:30:37 +0300 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 1 + cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f3fa16205e..1927e9c937c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Django templates for email and user guide () - Saving relative paths in dummy chunks instead of absolute() +- Reset zoom option doesn't work in tag annotation mode () ### Security diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 213d48575fd1..13a43d682e4c 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.0", + "version": "1.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index ac1e2ef2677b..a023aff6f07f 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.0", + "version": "1.10.1", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": {