Merge pull request #2443 from openvinotoolkit/bs/fixed_issue_2174

Fixed: Reset zoom option doesn't work in tag annotation mode
main
Boris Sekachev 5 years ago committed by GitHub
commit f0d99eef34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Wrong attribute can be removed in labels editor (<https://github.com/openvinotoolkit/cvat/pull/2436>) - Wrong attribute can be removed in labels editor (<https://github.com/openvinotoolkit/cvat/pull/2436>)
- UI fails with the error "Cannot read property 'label' of undefined" (<https://github.com/openvinotoolkit/cvat/pull/2442>) - UI fails with the error "Cannot read property 'label' of undefined" (<https://github.com/openvinotoolkit/cvat/pull/2442>)
- Exception: "Value must be a user instance" (<https://github.com/openvinotoolkit/cvat/pull/2441>) - Exception: "Value must be a user instance" (<https://github.com/openvinotoolkit/cvat/pull/2441>)
- Reset zoom option doesn't work in tag annotation mode (<https://github.com/openvinotoolkit/cvat/pull/2443>)
### Security ### Security

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.10.4", "version": "1.10.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.10.4", "version": "1.10.5",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -10,7 +10,9 @@ import Icon from 'antd/lib/icon';
import Layout from 'antd/lib/layout/layout'; import Layout from 'antd/lib/layout/layout';
import Slider, { SliderValue } from 'antd/lib/slider'; 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 { LogType } from 'cvat-logger';
import { Canvas } from 'cvat-canvas-wrapper'; import { Canvas } from 'cvat-canvas-wrapper';
import getCore from 'cvat-core-wrapper'; import getCore from 'cvat-core-wrapper';
@ -217,10 +219,7 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
this.updateCanvas(); this.updateCanvas();
} }
if ( if (prevProps.frame !== frameData.number && resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) {
prevProps.frame !== frameData.number &&
((resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) || workspace === Workspace.TAG_ANNOTATION)
) {
canvasInstance.html().addEventListener( canvasInstance.html().addEventListener(
'canvas.setup', 'canvas.setup',
() => { () => {
@ -304,7 +303,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private onCanvasShapeDrawn = (event: any): void => { 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) { if (!event.detail.continue) {
onShapeDrawn(); onShapeDrawn();
@ -327,7 +328,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasObjectsMerged = (event: any): void => { private onCanvasObjectsMerged = (event: any): void => {
const { jobInstance, frame, onMergeAnnotations, onMergeObjects } = this.props; const {
jobInstance, frame, onMergeAnnotations, onMergeObjects,
} = this.props;
onMergeObjects(false); onMergeObjects(false);
@ -340,7 +343,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasObjectsGroupped = (event: any): void => { private onCanvasObjectsGroupped = (event: any): void => {
const { jobInstance, frame, onGroupAnnotations, onGroupObjects } = this.props; const {
jobInstance, frame, onGroupAnnotations, onGroupObjects,
} = this.props;
onGroupObjects(false); onGroupObjects(false);
@ -349,7 +354,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasTrackSplitted = (event: any): void => { private onCanvasTrackSplitted = (event: any): void => {
const { jobInstance, frame, onSplitAnnotations, onSplitTrack } = this.props; const {
jobInstance, frame, onSplitAnnotations, onSplitTrack,
} = this.props;
onSplitTrack(false); onSplitTrack(false);
@ -429,7 +436,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasCursorMoved = async (event: any): Promise<void> => { private onCanvasCursorMoved = async (event: any): Promise<void> => {
const { jobInstance, activatedStateID, workspace, onActivateObject } = this.props; const {
jobInstance, activatedStateID, workspace, onActivateObject,
} = this.props;
if (workspace !== Workspace.STANDARD) { if (workspace !== Workspace.STANDARD) {
return; return;
@ -560,7 +569,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private updateShapesView(): void { private updateShapesView(): void {
const { annotations, opacity, colorBy, outlined, outlineColor } = this.props; const {
annotations, opacity, colorBy, outlined, outlineColor,
} = this.props;
for (const state of annotations) { for (const state of annotations) {
let shapeColor = ''; let shapeColor = '';
@ -588,7 +599,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private updateCanvas(): void { private updateCanvas(): void {
const { curZLayer, annotations, frameData, canvasInstance } = this.props; const {
curZLayer, annotations, frameData, canvasInstance,
} = this.props;
if (frameData !== null) { if (frameData !== null) {
canvasInstance.setup( canvasInstance.setup(

Loading…
Cancel
Save