interactivity was broken

This commit is contained in:
2025-07-05 19:32:13 +02:00
parent d5c5b32bd7
commit 37de8d087b
3 changed files with 34 additions and 3 deletions

View File

@ -266,21 +266,30 @@ class BitfielderApp {
// Touch tracking
window.addEventListener('touchstart', (e) => {
e.preventDefault();
// Only prevent default on canvas area for shader interaction
if (e.target === this.canvas) {
e.preventDefault();
}
this.touchCount = e.touches.length;
this.updateTouchPositions(e.touches);
this.initializePinchGesture(e.touches);
});
window.addEventListener('touchmove', (e) => {
e.preventDefault();
// Only prevent default on canvas area to allow UI scrolling
if (e.target === this.canvas) {
e.preventDefault();
}
this.touchCount = e.touches.length;
this.updateTouchPositions(e.touches);
this.updatePinchGesture(e.touches);
});
window.addEventListener('touchend', (e) => {
e.preventDefault();
// Only prevent default on canvas area
if (e.target === this.canvas) {
e.preventDefault();
}
this.touchCount = e.touches.length;
if (this.touchCount === 0) {
this.touch0X = this.touch0Y = this.touch1X = this.touch1Y = 0;