Skip to content

Commit

Permalink
Mask stays pixelated during editing (cvat-ai#7747)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Apr 11, 2024
1 parent 3fe396c commit b13191d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20240410_160047_boris_pixelated_masks_layer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- When user starts editing a mask, it becomes smoother (not pixelated)
(<https://github.com/cvat-ai/cvat/pull/7747>)
2 changes: 2 additions & 0 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ g.cvat_canvas_shape_occluded {
}

.cvat_masks_canvas_wrapper {
@extend .cvat_canvas_pixelized;

z-index: 3;
display: none;
}
Expand Down
6 changes: 3 additions & 3 deletions cvat-canvas/src/typescript/masksHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ export class MasksHandlerImpl implements MasksHandler {
opacity: 0.75,
left: this.latestMousePos.x - this.tool.size / 2,
top: this.latestMousePos.y - this.tool.size / 2,
stroke: 'white',
strokeWidth: 1,
stroke: 'white',
};
this.brushMarker = this.tool.form === 'circle' ? new fabric.Circle({
...common,
radius: this.tool.size / 2,
radius: Math.round(this.tool.size / 2),
}) : new fabric.Rect({
...common,
width: this.tool.size,
Expand Down Expand Up @@ -473,7 +473,7 @@ export class MasksHandlerImpl implements MasksHandler {
if (tool.form === 'circle') {
shape = new fabric.Circle({
...shapeProperties,
radius: tool.size / 2,
radius: Math.round(tool.size / 2),
});
} else if (tool.form === 'square') {
shape = new fabric.Rect({
Expand Down

0 comments on commit b13191d

Please sign in to comment.