diff --git a/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js b/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js index 701840f28c98..55d361a9ae49 100644 --- a/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js +++ b/cvat/apps/engine/static/engine/js/attributeAnnotationMode.js @@ -118,10 +118,7 @@ class AAMModel extends Listener { let [xtl, ytl, xbr, ybr] = this._bbRect(this._currentShapes[this._activeIdx].interpolation.position); this._focus(xtl - this._margin, xbr + this._margin, ytl - this._margin, ybr + this._margin); - this._active.activeAAM = { - shape: true, - attribute: attrId, - }; + this._active.activeAttribute = attrId; this.notify(); @@ -136,10 +133,7 @@ class AAMModel extends Listener { _deactivate() { if (this._activeAAM && this._active) { - this._active.activeAAM = { - shape: false, - attribute: null - }; + this._active.activeAttribute = null; } } diff --git a/cvat/apps/engine/static/engine/js/shapeCollection.js b/cvat/apps/engine/static/engine/js/shapeCollection.js index d9132b9de310..dc05a64bbf4b 100644 --- a/cvat/apps/engine/static/engine/js/shapeCollection.js +++ b/cvat/apps/engine/static/engine/js/shapeCollection.js @@ -99,10 +99,7 @@ class ShapeCollectionModel extends Listener { } if (this._activeAAMShape) { - this._activeAAMShape.activeAAM = { - shape: false, - attribute: null - }; + this._activeAAMShape.activeAttribute = null; } this._currentShapes = []; @@ -438,10 +435,7 @@ class ShapeCollectionModel extends Listener { this._activeShape = null; } if (this._activeAAMShape) { - this._activeAAMShape.activeAAM = { - shape: false, - attribute: null, - }; + this._activeAAMShape.activeAttribute = null; } this._frame = frame; this._interpolate(); @@ -454,8 +448,8 @@ class ShapeCollectionModel extends Listener { onShapeUpdate(model) { switch (model.updateReason) { - case 'activeAAM': - if (model.activeAAM.shape) { + case 'activeAttribute': + if (model.activeAttribute != null) { this._activeAAMShape = model; } else if (this._activeAAMShape === model) { diff --git a/cvat/apps/engine/static/engine/js/shapes.js b/cvat/apps/engine/static/engine/js/shapes.js index 9c61f930dc7b..7aeb327e09c7 100644 --- a/cvat/apps/engine/static/engine/js/shapes.js +++ b/cvat/apps/engine/static/engine/js/shapes.js @@ -30,8 +30,7 @@ class ShapeModel extends Listener { this._merging = false; this._active = false; this._selected = false; - this._activeAAM = false; - this._activeAAMAttributeId = null; + this._activeAttributeId = null; this._merge = false; this._hiddenShape = false; this._hiddenText = true; @@ -522,18 +521,14 @@ class ShapeModel extends Listener { return this._active; } - set activeAAM(active) { - this._activeAAM = active.shape; - this._activeAAMAttributeId = active.attribute; - this._updateReason = 'activeAAM'; + set activeAttribute(value) { + this._activeAttributeId = value; + this._updateReason = 'activeAttribute'; this.notify(); } - get activeAAM() { - return { - shape: this._activeAAM, - attributeId: this._activeAAMAttributeId - }; + get activeAttribute() { + return this._activeAttributeId; } set merge(value) { @@ -2438,7 +2433,10 @@ class ShapeView extends Listener { let interpolation = model.interpolate(window.cvat.player.frames.current); let hiddenText = model.hiddenText; let hiddenShape = model.hiddenShape; - let activeAAM = model.activeAAM; + let activeAAM = { + attributeId: model.activeAttribute, + shape: model.activeAttribute === null ? false : true, + } this._makeNotEditable(); this._deselect(); @@ -2512,7 +2510,7 @@ class ShapeView extends Listener { this._uis.attributes[attrId].select(); break; } - case 'activeAAM': + case 'activeAttribute': this._setupAAMView(activeAAM.shape, interpolation.position); setupHidden.call(this, hiddenShape, hiddenText, activeAAM, model.active, interpolation); @@ -2862,12 +2860,18 @@ class PolyShapeView extends ShapeView { this._hideShapeText(); } this._uis.shape.addClass('hidden'); + if (this._uis.points) { + this._uis.points.addClass('hidden'); + } // Run edit mode PolyShapeView.editor.edit(this._controller.type.split('_')[1], this._uis.shape.attr('points'), this._color, index, e, (points) => { this._uis.shape.removeClass('hidden'); + if (this._uis.points) { + this._uis.points.removeClass('hidden'); + } if (points) { this._uis.shape.attr('points', points); this._controller.updatePosition(window.cvat.player.frames.current, this._buildPosition()); @@ -3081,9 +3085,11 @@ class PointsView extends PolyShapeView { _makeNotEditable() { PolyShapeView.prototype._makeNotEditable.call(this); - let interpolation = this._controller.interpolate(window.cvat.player.frames.current); - if (interpolation.position.points) { - this._drawPointMarkers(interpolation.position); + if (!this._controller.hiddenShape) { + let interpolation = this._controller.interpolate(window.cvat.player.frames.current); + if (interpolation.position.points) { + this._drawPointMarkers(interpolation.position); + } } }