diff --git a/cvat/apps/engine/static/engine/js/3rdparty.patch b/cvat/apps/engine/static/engine/js/3rdparty.patch index 38f26000b637..c12855f4adf1 100644 --- a/cvat/apps/engine/static/engine/js/3rdparty.patch +++ b/cvat/apps/engine/static/engine/js/3rdparty.patch @@ -1,14 +1,14 @@ -From 5eeb1092c64865c555671ed585da18f974c9c10c Mon Sep 17 00:00:00 2001 +From d44089dfc96b56d427d5631442d6587f876f43b6 Mon Sep 17 00:00:00 2001 From: Boris Sekachev -Date: Tue, 18 Sep 2018 15:58:20 +0300 +Date: Mon, 19 Nov 2018 12:09:48 +0300 Subject: [PATCH] tmp --- .../engine/static/engine/js/3rdparty/svg.draggable.js | 1 + cvat/apps/engine/static/engine/js/3rdparty/svg.draw.js | 17 +++++++++++++++-- - .../apps/engine/static/engine/js/3rdparty/svg.resize.js | 5 +++-- + .../apps/engine/static/engine/js/3rdparty/svg.resize.js | 6 ++++-- .../apps/engine/static/engine/js/3rdparty/svg.select.js | 5 ++++- - 4 files changed, 23 insertions(+), 5 deletions(-) + 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/cvat/apps/engine/static/engine/js/3rdparty/svg.draggable.js b/cvat/apps/engine/static/engine/js/3rdparty/svg.draggable.js index d88abf5..aba474c 100644 @@ -78,7 +78,7 @@ index 68dbf2a..20a6917 100644 } diff --git a/cvat/apps/engine/static/engine/js/3rdparty/svg.resize.js b/cvat/apps/engine/static/engine/js/3rdparty/svg.resize.js -index 0c3b63d..fb5dc26 100644 +index 0c3b63d..dceede5 100644 --- a/cvat/apps/engine/static/engine/js/3rdparty/svg.resize.js +++ b/cvat/apps/engine/static/engine/js/3rdparty/svg.resize.js @@ -34,8 +34,8 @@ @@ -92,7 +92,15 @@ index 0c3b63d..fb5dc26 100644 }; }; -@@ -343,6 +343,7 @@ +@@ -98,6 +98,7 @@ + }; + + ResizeHandler.prototype.resize = function (event) { ++ if (event.detail.event.button) return; // only left mouse button + + var _this = this; + +@@ -343,6 +344,7 @@ } return; } diff --git a/cvat/apps/engine/static/engine/js/shapes.js b/cvat/apps/engine/static/engine/js/shapes.js index 8b05544c82b4..4dc4567a7580 100644 --- a/cvat/apps/engine/static/engine/js/shapes.js +++ b/cvat/apps/engine/static/engine/js/shapes.js @@ -1540,6 +1540,16 @@ class ShapeView extends Listener { deepSelect: true, }).resize(false); + if (this._flags.resizing) { + this._flags.resizing = false; + this.notify('resize'); + } + + if (this._flags.dragging) { + this._flags.dragging = false; + this.notify('drag'); + } + this._uis.shape.off('dragstart') .off('dragend') .off('resizestart') @@ -1547,6 +1557,7 @@ class ShapeView extends Listener { .off('resizedone') .off('contextmenu.contextMenu') .off('mousedown.contextMenu'); + this._flags.editable = false; } @@ -2705,25 +2716,39 @@ ShapeView.labels = function() { class BoxView extends ShapeView { constructor(boxModel, boxController, svgScene, menusScene) { super(boxModel, boxController, svgScene, menusScene); + + this._uis.boxSize = null; } _makeEditable() { if (this._uis.shape && this._uis.shape.node.parentElement && !this._flags.editable) { if (!this._controller.lock) { - let sizeObject = null; this._uis.shape.on('resizestart', (e) => { - sizeObject = drawBoxSize(this._scenes.svg, e.target); + if (this._uis.boxSize) { + this._uis.boxSize.rm(); + this._uis.boxSize = null; + } + + this._uis.boxSize = drawBoxSize(this._scenes.svg, e.target); }).on('resizing', (e) => { - sizeObject = drawBoxSize.call(sizeObject, this._scenes.svg, e.target); + this._uis.boxSize = drawBoxSize.call(this._uis.boxSize, this._scenes.svg, e.target); }).on('resizedone', () => { - sizeObject.rm(); + this._uis.boxSize.rm(); }); } ShapeView.prototype._makeEditable.call(this); } } + _makeNotEditable() { + if (this._uis.boxSize) { + this._uis.boxSize.rm(); + this._uis.boxSize = null; + } + ShapeView.prototype._makeNotEditable.call(this); + } + _buildPosition() { let shape = this._uis.shape.node; @@ -2756,7 +2781,6 @@ class BoxView extends ShapeView { ShapeView.prototype._drawShapeUI.call(this); } - _setupAAMView(active, pos) { let oldRect = $('#outsideRect'); let oldMask = $('#outsideMask');