未验证 提交 7850f1e9 编写于 作者: B Boris Sekachev 提交者: GitHub

Fixed changing label color on canvas (#5045)

* Fixed changing label color on canvas

* Updated changelog
上级 1902ecd8
......@@ -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>)
......
{
"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
) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册