Skip to content

Commit

Permalink
fix: Math.floor touch offset (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi authored May 22, 2024
1 parent cc228e2 commit 20e3b4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useMobileTouchMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function useMobileTouchMove(
} else {
offsetY *= SMOOTH_PTG;
}
const offset = isHorizontal ? offsetX : offsetY;
const offset = Math.floor(isHorizontal ? offsetX : offsetY);
if (!callback(isHorizontal, offset, true) || Math.abs(offset) <= 0.1) {
clearInterval(intervalRef.current);
}
Expand Down

0 comments on commit 20e3b4d

Please sign in to comment.