Fixed changing label color on canvas (#5045)

* Fixed changing label color on canvas

* Updated changelog
main
Boris Sekachev 3 years ago committed by GitHub
parent 1902ecd8a7
commit 7850f1e9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
(<https://github.com/openvinotoolkit/cvat/pull/4659>)
- Project import/export with skeletons (<https://github.com/opencv/cvat/pull/4867>,
<https://github.com/opencv/cvat/pull/5004>)
- Shape color is not changed on canvas after changing a label (<https://github.com/opencv/cvat/pull/5045>)
- Unstable e2e restore tests (<https://github.com/opencv/cvat/pull/5010>)
- IOG and f-BRS serverless function (<https://github.com/opencv/cvat/pulls>)

@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "2.15.3",
"version": "2.15.4",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {

@ -1864,7 +1864,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
drawnStateDescriptions.length !== stateDescriptions.length ||
drawnStateDescriptions.some((desc: string, id: number): boolean => desc !== stateDescriptions[id])
) {
// need to remove created text and create it again
// remove created text and create it again
if (text) {
text.remove();
this.svgTexts[state.clientID] = this.addText(state);
@ -1884,6 +1884,15 @@ export class CanvasViewImpl implements CanvasView, Listener {
}
}
if (drawnState.label.id !== state.label.id || drawnState.color !== state.color) {
// update shape color if necessary
if (shape) {
shape.attr({
...this.getShapeColorization(state),
});
}
}
if (
drawnState.group.id !== state.group.id || drawnState.group.color !== state.group.color
) {

Loading…
Cancel
Save