Skip to content

Commit

Permalink
[CVAT-UI] Fixed AAM bug: cvat-ai#1750 (cvat-ai#1755)
Browse files Browse the repository at this point in the history
* Fixed AAM bug: cvat-ai#1750

* Updated changelog and version
  • Loading branch information
bsekachev authored and Fernando Martínez González committed Aug 3, 2020
1 parent 8c92521 commit b02d376
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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
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.3.1",
"version": "1.3.2",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface StateToProps {
jobInstance: any;
keyMap: Record<string, ExtendedKeyMapOptions>;
normalizedKeyMap: Record<string, string>;
canvasIsReady: boolean;
}

interface DispatchToProps {
Expand All @@ -58,6 +59,9 @@ function mapStateToProps(state: CombinedState): StateToProps {
instance: jobInstance,
labels,
},
canvas: {
ready: canvasIsReady,
},
},
shortcuts: {
keyMap,
Expand All @@ -73,6 +77,7 @@ function mapStateToProps(state: CombinedState): StateToProps {
states,
keyMap,
normalizedKeyMap,
canvasIsReady,
};
}

Expand All @@ -98,6 +103,7 @@ function AttributeAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.
activateObject,
keyMap,
normalizedKeyMap,
canvasIsReady,
} = props;

const [labelAttrMap, setLabelAttrMap] = useState(
Expand All @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,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);
}
}

Expand Down

0 comments on commit b02d376

Please sign in to comment.