fixed false tag activation (#1541)

main
Dmitry Kalinin 6 years ago committed by GitHub
parent ccd2fbdf51
commit 2394fe63a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Sidebar in AAM has no hide/show button (<https://github.com/opencv/cvat/pull/1420>) - Sidebar in AAM has no hide/show button (<https://github.com/opencv/cvat/pull/1420>)
- Task/Job buttons has no "Open in new tab" option (<https://github.com/opencv/cvat/pull/1419>) - Task/Job buttons has no "Open in new tab" option (<https://github.com/opencv/cvat/pull/1419>)
- Delete point context menu option has no shortcut hint (<https://github.com/opencv/cvat/pull/1416>) - Delete point context menu option has no shortcut hint (<https://github.com/opencv/cvat/pull/1416>)
- Fixed issue with unnecessary tag activation in cvat-canvas (<https://github.com/opencv/cvat/issues/1540>)
### Security ### Security
- -

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

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

@ -562,16 +562,18 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} = this.props; } = this.props;
if (activatedStateID !== null) { if (activatedStateID !== null) {
const [activatedState] = annotations
.filter((state: any): boolean => state.clientID === activatedStateID);
if (workspace === Workspace.ATTRIBUTE_ANNOTATION) { if (workspace === Workspace.ATTRIBUTE_ANNOTATION) {
const [activatedState] = annotations
.filter((state: any): boolean => state.clientID === activatedStateID);
if (activatedState.objectType !== ObjectType.TAG) { if (activatedState.objectType !== ObjectType.TAG) {
canvasInstance.focus(activatedStateID, aamZoomMargin); canvasInstance.focus(activatedStateID, aamZoomMargin);
} else { } else {
canvasInstance.fit(); canvasInstance.fit();
} }
} }
canvasInstance.activate(activatedStateID, activatedAttributeID); if (activatedState.objectType !== ObjectType.TAG) {
canvasInstance.activate(activatedStateID, activatedAttributeID);
}
const el = window.document.getElementById(`cvat_canvas_shape_${activatedStateID}`); const el = window.document.getElementById(`cvat_canvas_shape_${activatedStateID}`);
if (el) { if (el) {
(el as any as SVGElement).setAttribute('fill-opacity', `${selectedOpacity / 100}`); (el as any as SVGElement).setAttribute('fill-opacity', `${selectedOpacity / 100}`);

Loading…
Cancel
Save