From dd2339cb932087bc7a208a3abb5c759880e9ad5d Mon Sep 17 00:00:00 2001 From: Maurice Conrad Date: Thu, 27 Jun 2024 12:03:55 +0200 Subject: [PATCH] fixes --- zoompinch-vue/package.json | 3 ++- zoompinch-vue/src/components/Zoompinch.vue | 7 ------- zoompinch-vue/src/controllers/touch.ts | 10 ++++------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/zoompinch-vue/package.json b/zoompinch-vue/package.json index b64ab54..566d31a 100644 --- a/zoompinch-vue/package.json +++ b/zoompinch-vue/package.json @@ -1,12 +1,13 @@ { "name": "zoompinch", "private": false, - "version": "0.0.37", + "version": "0.0.38", "type": "module", "files": [ "package.json", "lib" ], + "license": "MIT", "exports": { ".": { "import": "./lib/zoompinch.es.js", diff --git a/zoompinch-vue/src/components/Zoompinch.vue b/zoompinch-vue/src/components/Zoompinch.vue index a11849f..5fcb5ad 100644 --- a/zoompinch-vue/src/components/Zoompinch.vue +++ b/zoompinch-vue/src/components/Zoompinch.vue @@ -28,13 +28,6 @@
- - clientCoordsToWrapperCoords(touch.clientX, touch.clientY) - ); + // Make the touch positions become relative to the inner wrapper + const touchPositions = Array.from(event.touches).map((touch) => clientCoordsToWrapperCoords(touch.clientX, touch.clientY)); - if (touchPositions.length >= 2) { + if (touchStarts) { + if (touchPositions.length >= 2 && touchStarts.length >= 2) { // Multi finger touch implementation // We're calculating: // 1. The scale projection and scale relied delta