Skip to content

Commit

Permalink
[CVAT-UI] Fixed displaying on canvas in some cases (#1834)
Browse files Browse the repository at this point in the history
* Fixed displaying on canvas in some cases

* Updated changelog
  • Loading branch information
bsekachev authored Jul 2, 2020
1 parent 757f0ad commit 18f6b2f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-

### Fixed
-
- Some objects aren't shown on canvas sometimes. For example after propagation on of objects is invisible (<https://github.com/opencv/cvat/pull/1834>)

### Security
-
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/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-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "1.2.1",
"version": "1.2.2",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
if (value) {
if (shape) {
(state.shapeType === 'points' ? shape.remember('_selectHandler').nested : shape)
.style('display', 'none');
.addClass('cvat_canvas_hidden');
}

if (text) {
Expand All @@ -112,7 +112,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
if (!state.outside && !state.hidden) {
if (shape) {
(state.shapeType === 'points' ? shape.remember('_selectHandler').nested : shape)
.style('display', '');
.removeClass('cvat_canvas_hidden');
}

if (text) {
Expand Down Expand Up @@ -1244,13 +1244,13 @@ export class CanvasViewImpl implements CanvasView, Listener {
if (drawnState.hidden !== state.hidden || drawnState.outside !== state.outside) {
if (isInvisible) {
(state.shapeType === 'points' ? shape.remember('_selectHandler').nested : shape)
.style('display', 'none');
.addClass('cvat_canvas_hidden');
if (text) {
text.addClass('cvat_canvas_hidden');
}
} else {
(state.shapeType === 'points' ? shape.remember('_selectHandler').nested : shape)
.style('display', '');
.removeClass('cvat_canvas_hidden');
if (text) {
text.removeClass('cvat_canvas_hidden');
this.updateTextPosition(
Expand Down

0 comments on commit 18f6b2f

Please sign in to comment.