From dab54d11a6c7ce7025883011d659ca1f905c98b5 Mon Sep 17 00:00:00 2001 From: Maurice Conrad Date: Tue, 23 Apr 2024 17:50:31 +0200 Subject: [PATCH] default no pointer evenst on matrix --- zoompinch-vue/package.json | 2 +- zoompinch-vue/src/components/Zoompinch.vue | 1 + zoompinch-vue/src/controllers/touch.ts | 16 ++++++++-- ...vite.config.ts.timestamp-1713099900691.mjs | 30 ------------------- 4 files changed, 16 insertions(+), 33 deletions(-) delete mode 100644 zoompinch-vue/vite.config.ts.timestamp-1713099900691.mjs diff --git a/zoompinch-vue/package.json b/zoompinch-vue/package.json index 0c2b85e..1479211 100644 --- a/zoompinch-vue/package.json +++ b/zoompinch-vue/package.json @@ -1,7 +1,7 @@ { "name": "zoompinch", "private": false, - "version": "0.0.34", + "version": "0.0.35", "type": "module", "files": [ "package.json", diff --git a/zoompinch-vue/src/components/Zoompinch.vue b/zoompinch-vue/src/components/Zoompinch.vue index 3c57461..26520d5 100644 --- a/zoompinch-vue/src/components/Zoompinch.vue +++ b/zoompinch-vue/src/components/Zoompinch.vue @@ -311,6 +311,7 @@ defineExpose({ top: 0px; position: absolute; width: 100%; + pointer-events: none; height: 100%; > ::v-deep(*) { width: 100%; diff --git a/zoompinch-vue/src/controllers/touch.ts b/zoompinch-vue/src/controllers/touch.ts index ff30a87..a736fdb 100644 --- a/zoompinch-vue/src/controllers/touch.ts +++ b/zoompinch-vue/src/controllers/touch.ts @@ -61,16 +61,25 @@ export function useTouch({ }; const handleTouchstart = (event: TouchEvent) => { + const isWithinMatrix = (event.target as HTMLElement).closest('.matrix') !== null; + if (isWithinMatrix) { + return; + } + event.preventDefault(); touchStarts = freezeTouches(event.touches); touchStartScale = scale.value; touchStartTranslate = [translate.value[0], translate.value[1]]; touchStartRotate = rotate.value; - console.log('touchStarts', touchStarts); + //console.log('touchStarts', touchStarts); }; const handleTouchmove = (event: TouchEvent) => { + const isWithinMatrix = (event.target as HTMLElement).closest('.matrix') !== null; + if (isWithinMatrix) { + return; + } event.preventDefault(); // Prevent default touch behavior if (touchStarts) { @@ -187,7 +196,10 @@ export function useTouch({ } }; const handleTouchend = (event: TouchEvent) => { - //event.preventDefault(); + const isWithinMatrix = (event.target as HTMLElement).closest('.matrix') !== null; + if (isWithinMatrix) { + return; + } if (event.touches.length === 0) { touchStarts = null; diff --git a/zoompinch-vue/vite.config.ts.timestamp-1713099900691.mjs b/zoompinch-vue/vite.config.ts.timestamp-1713099900691.mjs deleted file mode 100644 index 819ad9c..0000000 --- a/zoompinch-vue/vite.config.ts.timestamp-1713099900691.mjs +++ /dev/null @@ -1,30 +0,0 @@ -// vite.config.ts -import { defineConfig } from "file:///Users/mauriceconrad/Documents/Beruf/creactive/Bluepic/open-source/zoompinch/zoompinch-vue/node_modules/vite/dist/node/index.js"; -import vue from "file:///Users/mauriceconrad/Documents/Beruf/creactive/Bluepic/open-source/zoompinch/zoompinch-vue/node_modules/@vitejs/plugin-vue/dist/index.mjs"; -import path from "path"; -import dts from "file:///Users/mauriceconrad/Documents/Beruf/creactive/Bluepic/open-source/zoompinch/zoompinch-vue/node_modules/vite-plugin-dts/dist/index.mjs"; -var vite_config_default = defineConfig({ - build: { - outDir: "./lib", - lib: { - entry: path.resolve("src/index.ts"), - name: "Zoompinch", - fileName: (format) => `zoompinch.${format}.js`, - formats: ["es", "umd"] - }, - rollupOptions: { - external: ["vue"], - output: { - sourcemap: false, - globals: { - vue: "Vue" - } - } - } - }, - plugins: [vue(), dts()] -}); -export { - vite_config_default as default -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvbWF1cmljZWNvbnJhZC9Eb2N1bWVudHMvQmVydWYvY3JlYWN0aXZlL0JsdWVwaWMvb3Blbi1zb3VyY2Uvem9vbX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