|
@@ -22,7 +22,7 @@
|
|
|
@play="videoPlay" @jump="videoJump"/>
|
|
|
</template>
|
|
|
|
|
|
- <!-- <div style="position: absolute; top: 0.5rem; left: 0.5rem">{{ data }}</div> -->
|
|
|
+ <!-- <div style="position: absolute; top: 0.5rem; left: 0.5rem">{{ extremeClicking }}</div> -->
|
|
|
|
|
|
<annotation-box v-if="current"
|
|
|
:image="image"
|
|
@@ -51,7 +51,7 @@ import VideoControl from "@/components/media/video-control";
|
|
|
export default {
|
|
|
name: "annotated-image",
|
|
|
components: {VideoControl, AnnotationBox},
|
|
|
- props: ['data', 'project', 'socket', 'filter'],
|
|
|
+ props: ['data', 'project', 'socket', 'filter', 'extremeClicking'],
|
|
|
mounted: function () {
|
|
|
window.addEventListener("resize", this.resizeEvent);
|
|
|
this.resizeEvent();
|
|
@@ -74,6 +74,11 @@ export default {
|
|
|
};
|
|
|
|
|
|
this.resizeEvent();
|
|
|
+ },
|
|
|
+ extremeClicking: function (newValue) {
|
|
|
+ if (!newValue && this.current) {
|
|
|
+ this.release();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data: function () {
|
|
@@ -204,13 +209,29 @@ export default {
|
|
|
return rectangle;
|
|
|
},
|
|
|
press: function (event) {
|
|
|
- this.start = {
|
|
|
- x: this.getX(event),
|
|
|
- y: this.getY(event)
|
|
|
- };
|
|
|
+ const x = this.getX(event);
|
|
|
+ const y = this.getY(event);
|
|
|
+
|
|
|
+ if (this.extremeClicking && this.start) {
|
|
|
+ if (this.current) {
|
|
|
+ const minX = Math.min(x, this.current.x);
|
|
|
+ const maxX = Math.max(x, this.current.x + this.current.w);
|
|
|
+ const minY = Math.min(y, this.current.y);
|
|
|
+ const maxY = Math.max(y, this.current.y + this.current.h);
|
|
|
+
|
|
|
+ this.current = this.buildRectangle(minX, minY, maxX, maxY);
|
|
|
+ } else {
|
|
|
+ this.current = this.buildRectangle(this.start.x, this.start.y, x, y);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.start = {
|
|
|
+ x: x,
|
|
|
+ y: y
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
track: function (event) {
|
|
|
- if (this.start) {
|
|
|
+ if (this.start && !this.extremeClicking) {
|
|
|
const x = this.getX(event);
|
|
|
const y = this.getY(event);
|
|
|
|
|
@@ -218,7 +239,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
release: function () {
|
|
|
- if (this.start) {
|
|
|
+ if (this.start && !this.extremeClicking) {
|
|
|
if (this.callback)
|
|
|
this.callback(this.current);
|
|
|
else
|