diff --git a/src/pages/detect.vue b/src/pages/detect.vue
index 0b8a6f5..bdbd080 100644
--- a/src/pages/detect.vue
+++ b/src/pages/detect.vue
@@ -15,7 +15,7 @@
Capture
-
+
{
+ this.canvasOffset = {x: 0, y: 0}
+ this.canvasZoom = 1
const imCanvas = this.$refs.image_cvs
imCanvas.width = imCanvas.clientWidth
imCanvas.height = imCanvas.clientHeight
@@ -602,6 +609,34 @@
f7.utils.nextFrame(() => {
this.selectChip("redraw")
})
+ },
+ startMove() {
+ this.canvasMoving = true
+ },
+ endMove() {
+ this.canvasMoving = false
+ },
+ makeMove(event) {
+ if (this.canvasMoving) {
+ this.canvasOffset.x += event.movementX
+ this.canvasOffset.y += event.movementY
+ this.selectChip("redraw")
+ }
+ },
+ spinWheel(event) {
+ console.log(this.canvasOffset)
+ console.log({x: event.clientX, y: event.clientY})
+ if (event.wheelDelta > 0) {
+ this.canvasZoom *= 1.05
+ this.canvasOffset.x = (((1.05 ** -1) - 1)*event.clientX + this.canvasOffset.x)*1.05
+ this.canvasOffset.y = (((1.05 ** -1) - 1)*event.clientY + this.canvasOffset.y)*1.05
+ } else if (event.wheelDelta < 0) {
+ this.canvasZoom /= 1.05
+ this.canvasOffset.x = ((.05)*event.clientX + this.canvasOffset.x)/1.05
+ this.canvasOffset.y = ((.05)*event.clientY + this.canvasOffset.y)/1.05
+ }
+ console.log(this.canvasOffset)
+ this.selectChip("redraw")
}
}
}