Skip to content
Merged
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
7 changes: 7 additions & 0 deletions manual/en/offscreencanvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ <h1>OffscreenCanvas</h1>
'pointerType',
'clientX',
'clientY',
'pointerId',
'pageX',
'pageY',
]);
Expand Down Expand Up @@ -853,13 +854,19 @@ <h1>OffscreenCanvas</h1>
}

function touchEventHandler(event, sendFn) {
// preventDefault() fixes mousemove, mouseup and mousedown
// firing when doing a simple touchup touchdown
// Happens only at offscreen canvas
event.preventDefault();
const touches = [];
const data = {type: event.type, touches};
for (let i = 0; i &lt; event.touches.length; ++i) {
const touch = event.touches[i];
touches.push({
pageX: touch.pageX,
pageY: touch.pageY,
clientX: touch.clientX,
clientY: touch.clientY,
});
}
sendFn(data);
Expand Down
9 changes: 8 additions & 1 deletion manual/examples/offscreencanvas-w-orbitcontrols.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'pointerType',
'clientX',
'clientY',
'pointerId',
'pageX',
'pageY',
] );
Expand Down Expand Up @@ -84,7 +85,11 @@
}

function touchEventHandler( event, sendFn ) {


// preventDefault() fixes mousemove, mouseup and mousedown
// firing at touch events when doing a simple touchup touchdown
// Happens only at offscreen canvas
event.preventDefault();
const touches = [];
const data = { type: event.type, touches };
for ( let i = 0; i < event.touches.length; ++ i ) {
Expand All @@ -93,6 +98,8 @@
touches.push( {
pageX: touch.pageX,
pageY: touch.pageY,
clientX: touch.clientX,
clientY: touch.clientY,
} );

}
Expand Down
7 changes: 7 additions & 0 deletions manual/ja/offscreencanvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ <h1>のOffscreenCanvas</h1>
'pointerType',
'clientX',
'clientY',
'pointerId',
'pageX',
'pageY',
]);
Expand Down Expand Up @@ -805,13 +806,19 @@ <h1>のOffscreenCanvas</h1>
}

function touchEventHandler(event, sendFn) {
// preventDefault() fixes mousemove, mouseup and mousedown
// firing when doing a simple touchup touchdown
// Happens only at offscreen canvas
event.preventDefault();
const touches = [];
const data = {type: event.type, touches};
for (let i = 0; i &lt; event.touches.length; ++i) {
const touch = event.touches[i];
touches.push({
pageX: touch.pageX,
pageY: touch.pageY,
clientX: touch.clientX,
clientY: touch.clientY,
});
}
sendFn(data);
Expand Down
7 changes: 7 additions & 0 deletions manual/ko/offscreencanvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ <h1>OffscreenCanvas</h1>
'pointerType',
'clientX',
'clientY',
'pointerId',
'pageX',
'pageY',
]);
Expand Down Expand Up @@ -755,13 +756,19 @@ <h1>OffscreenCanvas</h1>
}

function touchEventHandler(event, sendFn) {
// preventDefault() fixes mousemove, mouseup and mousedown
// firing when doing a simple touchup touchdown
// Happens only at offscreen canvas
event.preventDefault();
const touches = [];
const data = { type: event.type, touches };
for (let i = 0; i &lt; event.touches.length; ++i) {
const touch = event.touches[i];
touches.push({
pageX: touch.pageX,
pageY: touch.pageY,
clientX: touch.clientX,
clientY: touch.clientY,
});
}
sendFn(data);
Expand Down
7 changes: 7 additions & 0 deletions manual/ru/offscreencanvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ <h1>OffscreenCanvas</h1>
'pointerType',
'clientX',
'clientY',
'pointerId',
'pageX',
'pageY',
]);
Expand Down Expand Up @@ -786,13 +787,19 @@ <h1>OffscreenCanvas</h1>
}

function touchEventHandler(event, sendFn) {
// preventDefault() fixes mousemove, mouseup and mousedown
// firing when doing a simple touchup touchdown
// Happens only at offscreen canvas
event.preventDefault();
const touches = [];
const data = {type: event.type, touches};
for (let i = 0; i &lt; event.touches.length; ++i) {
const touch = event.touches[i];
touches.push({
pageX: touch.pageX,
pageY: touch.pageY,
clientX: touch.clientX,
clientY: touch.clientY,
});
}
sendFn(data);
Expand Down