selezione riscaldi con touch
This commit is contained in:
+14
-3
@@ -196,11 +196,22 @@ export default class Warmers extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
getSvgCoords(evt: MouseEvent): selectionPoint {
|
||||
getSvgCoords(evt: MouseEvent | TouchEvent): selectionPoint {
|
||||
var e = this.$refs.warmer as any;
|
||||
var dim = e.getBoundingClientRect();
|
||||
var x = evt.clientX - dim.left;
|
||||
var y = evt.clientY - dim.top;
|
||||
|
||||
var x = null;
|
||||
var y = null;
|
||||
|
||||
if ((evt as TouchEvent).touches)
|
||||
for (const touch of Array.from((evt as TouchEvent).touches).slice(0, 1)) {
|
||||
x = touch.clientX - dim.left;
|
||||
y = touch.clientY - dim.top;
|
||||
}
|
||||
else {
|
||||
x = (evt as MouseEvent).clientX - dim.left;
|
||||
y = (evt as MouseEvent).clientY - dim.top;
|
||||
}
|
||||
let sizes = this.zoomController?.getSizes();
|
||||
let pan = this.zoomController?.getPan();
|
||||
x -= pan.x;
|
||||
|
||||
+3
@@ -4,6 +4,9 @@
|
||||
@mousedown="startSelection"
|
||||
@mouseup="stopSelection"
|
||||
@mousemove.capture="moveSelection"
|
||||
v-on:touchstart="startSelection"
|
||||
v-on:touchend="stopSelection"
|
||||
v-on:touchmove="moveSelection"
|
||||
>
|
||||
<g>
|
||||
<g v-for="row in rows" :key="row">
|
||||
|
||||
Reference in New Issue
Block a user