[CVAT-UI] Fixed displaying on canvas in some cases (#1834)

* Fixed displaying on canvas in some cases

* Updated changelog
main
Boris Sekachev 6 years ago committed by GitHub
parent 757f0ade17
commit 18f6b2f95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- -
### Fixed ### 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 ### Security
- -

@ -1,6 +1,6 @@
{ {
"name": "cvat-canvas", "name": "cvat-canvas",
"version": "1.2.1", "version": "1.2.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

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

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

Loading…
Cancel
Save