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

Commit

Permalink
Merge pull request #4 from Belchy06/Fix_touch_input
Browse files Browse the repository at this point in the history
Fix touch input not assigning the correct finger indices.
  • Loading branch information
Belchy06 committed Jun 29, 2022
2 parents 49ccb39 + 56e2ad5 commit 04a8418
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SignallingWebServer/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,8 @@ function registerTouchEvents(playerElement) {

function forgetTouch(touch) {
fingers.push(fingerIds[touch.identifier]);
// Sort array back into descending order. This means if finger '1' were to lift after finger '0', we would ensure that 0 will be the first index to pop
fingers.sort(function(a, b){return b - a});
delete fingerIds[touch.identifier];
}

Expand Down

0 comments on commit 04a8418

Please sign in to comment.