Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 664d40b

Browse files
authored
Update TouchStart and TouchMove handlers to force a touch force of 1 if the touch.force member is 0 (#486)
1 parent 5cf2735 commit 664d40b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Frontend/library/src/Inputs/TouchController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class TouchController implements ITouchController {
178178
coord.x,
179179
coord.y,
180180
this.fingerIds.get(touch.identifier),
181-
this.maxByteValue * touch.force,
181+
this.maxByteValue * (touch.force > 0 ? touch.force : 1),
182182
coord.inRange ? 1 : 0
183183
]);
184184
break;
@@ -198,7 +198,7 @@ export class TouchController implements ITouchController {
198198
coord.x,
199199
coord.y,
200200
this.fingerIds.get(touch.identifier),
201-
this.maxByteValue * touch.force,
201+
this.maxByteValue * (touch.force > 0 ? touch.force : 1),
202202
coord.inRange ? 1 : 0
203203
]);
204204
break;

0 commit comments

Comments
 (0)