changeset 218:e72e74453581

Revert use of local touches for now, as the spectrogram layer doesn't work with it.
author Lucas Thompson <dev@lucas.im>
date Thu, 30 Mar 2017 16:02:58 +0100
parents 9d5f377cc006
children 1bd03ac62ee5
files src/app/waveform/waveform.component.ts
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts	Thu Mar 30 15:57:51 2017 +0100
+++ b/src/app/waveform/waveform.component.ts	Thu Mar 30 16:02:58 2017 +0100
@@ -282,17 +282,17 @@
       };
 
       const zoom = (ev) => {
-        if (ev.targetTouches.length < 2) return;
+        if (ev.touches.length < 2) return;
         ev.preventDefault();
         const minZoom = componentTimeline.state.minZoom;
         const maxZoom = componentTimeline.state.maxZoom;
         const p1: Point = {
-          x: ev.targetTouches[0].clientX,
-          y: ev.targetTouches[0].clientY
+          x: ev.touches[0].clientX,
+          y: ev.touches[0].clientY
         };
         const p2: Point = {
-          x: ev.targetTouches[1].clientX,
-          y: ev.targetTouches[1].clientY
+          x: ev.touches[1].clientX,
+          y: ev.touches[1].clientY
         };
         const distance = calculateDistance(p1, p2);
         const midPoint = calculateMidPoint(p1, p2);
@@ -322,16 +322,16 @@
 
       const element: HTMLElement = this.trackDiv.nativeElement;
       element.addEventListener('touchstart', (e) => {
-        if (e.targetTouches.length < 2) return;
+        if (e.touches.length < 2) return;
         isZooming = true;
         initialZoom = componentTimeline.timeContext.zoom;
 
         initialDistance = calculateDistance({
-          x: e.targetTouches[0].clientX,
-          y: e.targetTouches[0].clientY
+          x: e.touches[0].clientX,
+          y: e.touches[0].clientY
         }, {
-          x: e.targetTouches[1].clientX,
-          y: e.targetTouches[1].clientY
+          x: e.touches[1].clientX,
+          y: e.touches[1].clientY
         });
       });
       element.addEventListener('touchend', () => {