Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceConrad committed Jun 27, 2024
1 parent 2497dc4 commit dd2339c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
3 changes: 2 additions & 1 deletion zoompinch-vue/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 0 additions & 7 deletions zoompinch-vue/src/components/Zoompinch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
<slot name="canvas" />
</div>
<div ref="matrixRef" class="matrix">
<!-- <div class="offset-rect"></div>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<circle :cx="composePoint(0, 0)[0]" :cy="composePoint(0, 0)[1]" r="5" />
<circle :cx="composePoint(1, 0)[0]" :cy="composePoint(1, 0)[1]" r="5" />
<circle :cx="composePoint(1, 1)[0]" :cy="composePoint(1, 1)[1]" r="5" />
<circle :cx="composePoint(0, 1)[0]" :cy="composePoint(0, 1)[1]" r="5" />
</svg> -->
<slot
name="matrix"
:compose-point="composePoint"
Expand Down
10 changes: 4 additions & 6 deletions zoompinch-vue/src/controllers/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ export function useTouch({
}
event.preventDefault(); // Prevent default touch behavior

if (touchStarts) {
// Make the touch positions become relative to the inner wrapper
const touchPositions = Array.from(event.touches).map((touch) =>
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
Expand Down

0 comments on commit dd2339c

Please sign in to comment.