Skip to content

Commit 20e3b4d

Browse files
authored
fix: Math.floor touch offset (#273)
1 parent cc228e2 commit 20e3b4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useMobileTouchMove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function useMobileTouchMove(
4545
} else {
4646
offsetY *= SMOOTH_PTG;
4747
}
48-
const offset = isHorizontal ? offsetX : offsetY;
48+
const offset = Math.floor(isHorizontal ? offsetX : offsetY);
4949
if (!callback(isHorizontal, offset, true) || Math.abs(offset) <= 0.1) {
5050
clearInterval(intervalRef.current);
5151
}

0 commit comments

Comments
 (0)