Skip to content

Commit

Permalink
Merge pull request #2443 from openvinotoolkit/bs/fixed_issue_2174
Browse files Browse the repository at this point in the history
Fixed: Reset zoom option doesn't work in tag annotation mode
  • Loading branch information
Boris Sekachev authored Nov 17, 2020
2 parents eef5a41 + 0015d51 commit f0d99ee
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
- 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>)
- Reset zoom option doesn't work in tag annotation mode (<https://github.com/openvinotoolkit/cvat/pull/2443>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.10.4",
"version": "1.10.5",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -217,10 +219,7 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
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',
() => {
Expand Down Expand Up @@ -304,7 +303,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}

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();
Expand All @@ -327,7 +328,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
};

private onCanvasObjectsMerged = (event: any): void => {
const { jobInstance, frame, onMergeAnnotations, onMergeObjects } = this.props;
const {
jobInstance, frame, onMergeAnnotations, onMergeObjects,
} = this.props;

onMergeObjects(false);

Expand All @@ -340,7 +343,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
};

private onCanvasObjectsGroupped = (event: any): void => {
const { jobInstance, frame, onGroupAnnotations, onGroupObjects } = this.props;
const {
jobInstance, frame, onGroupAnnotations, onGroupObjects,
} = this.props;

onGroupObjects(false);

Expand All @@ -349,7 +354,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
};

private onCanvasTrackSplitted = (event: any): void => {
const { jobInstance, frame, onSplitAnnotations, onSplitTrack } = this.props;
const {
jobInstance, frame, onSplitAnnotations, onSplitTrack,
} = this.props;

onSplitTrack(false);

Expand Down Expand Up @@ -429,7 +436,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
};

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) {
return;
Expand Down Expand Up @@ -560,7 +569,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}

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 = '';
Expand Down Expand Up @@ -588,7 +599,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}

private updateCanvas(): void {
const { curZLayer, annotations, frameData, canvasInstance } = this.props;
const {
curZLayer, annotations, frameData, canvasInstance,
} = this.props;

if (frameData !== null) {
canvasInstance.setup(
Expand Down

0 comments on commit f0d99ee

Please sign in to comment.