Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Reset zoom option doesn't work in tag annotation mode #2443

Merged
merged 3 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/openvinotoolkit/cvat/pull/2412>)
- Saving relative paths in dummy chunks instead of absolute(<https://github.com/openvinotoolkit/cvat/pull/2424>)
- 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.0",
"version": "1.10.1",
"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