|
@@ -1,6 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div ref="main" class="main">
|
|
<div ref="main" class="main">
|
|
- <canvas ref="canvas" class="canvas" @mousedown.prevent="onMouseDown" @touchstart.prevent="onTouchStart" oncontextmenu="return false;"></canvas>
|
|
|
|
|
|
+ <canvas ref="canvas" class="canvas" @mousedown.prevent.stop="onMouseDown" @wheel.prevent.stop="onMouseWheel"
|
|
|
|
+ @touchstart.prevent.stop="onTouchStart" oncontextmenu="return false;"></canvas>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -329,28 +330,24 @@ class TextPage extends Vue {
|
|
onTouchStart(event) {
|
|
onTouchStart(event) {
|
|
if (event.touches.length == 1) {
|
|
if (event.touches.length == 1) {
|
|
const touch = event.touches[0];
|
|
const touch = event.touches[0];
|
|
- const result = this.handleClick(touch.clientX, touch.clientY)
|
|
|
|
-
|
|
|
|
- if (result) {
|
|
|
|
- event.stopPropagation();
|
|
|
|
- event.preventDefault();
|
|
|
|
- }
|
|
|
|
|
|
+ this.handleClick(touch.clientX, touch.clientY)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
onMouseDown(event) {
|
|
onMouseDown(event) {
|
|
- let result = false;
|
|
|
|
if (event.button == 0) {
|
|
if (event.button == 0) {
|
|
- result = this.handleClick(event.clientX, event.clientY);
|
|
|
|
|
|
+ this.handleClick(event.clientX, event.clientY);
|
|
} else if (event.button == 2) {
|
|
} else if (event.button == 2) {
|
|
this.doToolBarToggle();
|
|
this.doToolBarToggle();
|
|
- result = true;
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- if (result) {
|
|
|
|
- event.stopPropagation();
|
|
|
|
- event.preventDefault();
|
|
|
|
|
|
+ onMouseWheel(event) {
|
|
|
|
+ if (event.deltaY > 0) {
|
|
|
|
+ this.doDown();
|
|
|
|
+ } else if (event.deltaY < 0) {
|
|
|
|
+ this.doUp();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|