fix: fix wrong ternary expression (#10426)

This commit is contained in:
zhbhun 2022-03-23 21:52:35 +08:00 committed by GitHub
parent 334699d264
commit 12a0f9a24c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ export function useTouch() {
const move = ((event: TouchEvent) => {
const touch = event.touches[0];
// safari back will set clientX to negative number
deltaX.value = touch.clientX < 0 ? 0 : touch.clientX - startX.value;
deltaX.value = (touch.clientX < 0 ? 0 : touch.clientX) - startX.value;
deltaY.value = touch.clientY - startY.value;
offsetX.value = Math.abs(deltaX.value);
offsetY.value = Math.abs(deltaY.value);