Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/pink-trombone.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pink-trombone.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions script/graphics/TractUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,14 @@ class TractUI {
});
}

_getTouchIdentifier(event) {
return window.Touch !== undefined && (event instanceof Touch)
? event.identifier
: -1;
}

_startEvent(event) {
const touchIdentifier = (event instanceof Touch)?
event.identifier :
-1;
const touchIdentifier = this._getTouchIdentifier(event);

if(this._touchConstrictionIndices[touchIdentifier] == undefined) {
const position = this._getEventPosition(event);
Expand All @@ -545,9 +549,7 @@ class TractUI {
}
}
_moveEvent(event) {
const touchIdentifier = (event instanceof Touch)?
event.identifier :
-1;
const touchIdentifier = this._getTouchIdentifier(event);

if(this._touchConstrictionIndices[touchIdentifier] !== undefined) {
const position = this._getEventPosition(event);
Expand All @@ -570,9 +572,7 @@ class TractUI {
}
}
_endEvent(event) {
const touchIdentifier = (event instanceof Touch)?
event.identifier :
-1;
const touchIdentifier = this._getTouchIdentifier(event);

if(this._touchConstrictionIndices[touchIdentifier] !== undefined) {
const constrictionIndex = this._touchConstrictionIndices[touchIdentifier];
Expand Down