[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 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>) - 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>) - 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 ### Security

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

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

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

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

Loading…
Cancel
Save