Skip to content

Commit

Permalink
🔧 Merge dated develop commits into repo
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Aug 15, 2019
2 parents f7cd05f + fa78e39 commit 2140708
Show file tree
Hide file tree
Showing 5 changed files with 731 additions and 374 deletions.
20 changes: 14 additions & 6 deletions app/data/ct.libs/touch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
lastPanY = 0,
lastScaleDistance = 0,
lastRotation = 0;
var released = [];
// updates Action system's input methods for singular, double and triple touches
var countTouches = () => {
setKey('Any', ct.touch.events.length > 0? 1 : 0);
Expand Down Expand Up @@ -85,7 +84,7 @@
for (let i = 0; i < touches.length; i++) {
const ind = findTouchId(touches[i].identifier);
if (ind !== -1) {
released.push(ct.touch.events.splice(ind, 1)[0]);
ct.touch.released.push(ct.touch.events.splice(ind, 1)[0]);
}
}
countTouches();
Expand Down Expand Up @@ -123,6 +122,7 @@
}
};
ct.touch = {
released: [],
setupListeners() {
document.addEventListener('touchstart', handleStart, false);
document.addEventListener('touchstart', () => {
Expand All @@ -149,10 +149,10 @@
countTouches();
},
clearReleased() {
released.length = 0;
ct.touch.released.length = 0;
},
collide(copy, id, rel) {
var set = rel? released : ct.touch.events;
var set = rel? ct.touch.released : ct.touch.events;
if (id !== void 0 && id !== false) {
const i = findTouchId(id);
if (i === -1) {
Expand All @@ -164,7 +164,11 @@
shape: {
type: set[i].r? 'circle' : 'point',
r: set[i].r
}
},
scale: {
x: 1,
y: 1
}
});
}
for (let i = 0, l = set.length; i < l; i++) {
Expand All @@ -174,7 +178,11 @@
shape: {
type: set[i].r? 'circle' : 'point',
r: set[i].r
}
},
scale: {
x: 1,
y: 1
}
})) {
return true;
}
Expand Down
Loading

0 comments on commit 2140708

Please sign in to comment.