[CVAT-UI] Fixed AAM bug: #1750 (#1755)

* Fixed AAM bug: #1750

* Updated changelog and version
main
Boris Sekachev 6 years ago committed by GitHub
parent 4047df9944
commit e1e90e182c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Wrong description on register view for the username field (<https://github.com/opencv/cvat/pull/1667>)
- Wrong resolution for resizing a shape (<https://github.com/opencv/cvat/pull/1667>)
- React warning because of not unique keys in labels viewer (<https://github.com/opencv/cvat/pull/1727>)
- A couple of exceptions in AAM related with early object activation (<https://github.com/opencv/cvat/pull/1755>)
### Security

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

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

@ -35,6 +35,7 @@ interface StateToProps {
jobInstance: any;
keyMap: Record<string, ExtendedKeyMapOptions>;
normalizedKeyMap: Record<string, string>;
canvasIsReady: boolean;
}
interface DispatchToProps {
@ -58,6 +59,9 @@ function mapStateToProps(state: CombinedState): StateToProps {
instance: jobInstance,
labels,
},
canvas: {
ready: canvasIsReady,
},
},
shortcuts: {
keyMap,
@ -73,6 +77,7 @@ function mapStateToProps(state: CombinedState): StateToProps {
states,
keyMap,
normalizedKeyMap,
canvasIsReady,
};
}
@ -98,6 +103,7 @@ function AttributeAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.
activateObject,
keyMap,
normalizedKeyMap,
canvasIsReady,
} = props;
const [labelAttrMap, setLabelAttrMap] = useState(
@ -117,14 +123,16 @@ function AttributeAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.
? labelAttrMap[activeObjectState.label.id]
: null;
if (activeObjectState) {
const attribute = labelAttrMap[activeObjectState.label.id];
if (attribute && attribute.id !== activatedAttributeID) {
activateObject(activatedStateID, attribute ? attribute.id : null);
if (canvasIsReady) {
if (activeObjectState) {
const attribute = labelAttrMap[activeObjectState.label.id];
if (attribute && attribute.id !== activatedAttributeID) {
activateObject(activatedStateID, attribute ? attribute.id : null);
}
} else if (states.length) {
const attribute = labelAttrMap[states[0].label.id];
activateObject(states[0].clientID, attribute ? attribute.id : null);
}
} else if (states.length) {
const attribute = labelAttrMap[states[0].label.id];
activateObject(states[0].clientID, attribute ? attribute.id : null);
}
const nextObject = (step: number): void => {

@ -618,14 +618,12 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
const {
annotations,
frameData,
frameAngle,
canvasInstance,
} = this.props;
if (frameData !== null) {
canvasInstance.setup(frameData, annotations
.filter((e) => e.objectType !== ObjectType.TAG));
canvasInstance.rotate(frameAngle);
}
}

Loading…
Cancel
Save