Browse Source

Merge branch '97-extreme-clicking-drag' into 'master'

Resolve "extreme clicking drag"

Closes #97

See merge request troebs/pycs!111
Eric Tröbs 3 năm trước cách đây
mục cha
commit
dccef8f6c8
1 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 11 2
      webui/src/components/media/annotation-overlay.vue

+ 11 - 2
webui/src/components/media/annotation-overlay.vue

@@ -42,7 +42,8 @@ export default {
       callback: false,
       start: false,
       fixed: false,
-      current: false
+      current: false,
+      mousedown: false
     }
   },
   computed: {
@@ -117,6 +118,8 @@ export default {
       }
     },
     press: function (event) {
+      this.mousedown = true;
+
       if (this.interaction === 'draw-box') {
         this.start = this.getEventCoordinates(event);
       }
@@ -159,8 +162,12 @@ export default {
       }
     },
     track: function (event) {
-      if (this.interaction === 'extreme-clicking')
+      if (this.interaction === 'extreme-clicking') {
+        if (this.mousedown)
+          this.press(event);
+
         return;
+      }
 
       if (this.start) {
         const coordinates = this.getEventCoordinates(event);
@@ -168,6 +175,8 @@ export default {
       }
     },
     release: function () {
+      this.mousedown = false;
+
       if (this.interaction === 'extreme-clicking')
         return;