mirror of
https://github.com/PavelDoGreat/WebGL-Fluid-Simulation.git
synced 2025-10-04 01:41:53 +02:00
fx
This commit is contained in:
21
script.js
21
script.js
@@ -1006,20 +1006,13 @@ window.addEventListener('mouseup', function () {
|
|||||||
canvas.addEventListener('touchstart', function (e) {
|
canvas.addEventListener('touchstart', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var touches = e.targetTouches;
|
var touches = e.targetTouches;
|
||||||
var loop = function ( i ) {
|
for (var i = 0; i < touches.length; i++) {
|
||||||
var touch = touches[i];
|
if (i >= pointers.length)
|
||||||
var pointer = pointers.find(function (p) { return p.id == touch.identifier; });
|
{ pointers.push(new pointerPrototype()); }
|
||||||
if (pointer == null)
|
var posX = scaleByPixelRatio(touches[i].pageX);
|
||||||
{
|
var posY = scaleByPixelRatio(touches[i].pageY);
|
||||||
pointer = new pointerPrototype();
|
updatePointerDownData(pointers[i], touches[i].identifier, posX, posY);
|
||||||
pointers.push(pointer);
|
}
|
||||||
}
|
|
||||||
var posX = scaleByPixelRatio(touch.pageX);
|
|
||||||
var posY = scaleByPixelRatio(touch.pageY);
|
|
||||||
updatePointerDownData(pointer, touch.identifier, posX, posY);
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i = 0; i < touches.length; i++) loop( i );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
canvas.addEventListener('touchmove', function (e) {
|
canvas.addEventListener('touchmove', function (e) {
|
||||||
|
Reference in New Issue
Block a user