Fix fullscreen fit gesture clash and double swipe-remove in Framework7 layout

This commit is contained in:
Jonathan Sykes
2026-10-06 04:19:01 +08:00
parent bd80ad1ea0
commit 3be7a7b194
2 changed files with 6 additions and 17 deletions

View File

@@ -42,18 +42,7 @@
hud.addEventListener('click', revealControls);
play.onclick = toggle; exit.onclick = leave;
fitButton.onclick = () => setFit(settings().fullscreenFit === 'fill' ? 'fit' : 'fill');
let lastTap = 0, pointers = new Set();
stage.addEventListener('pointerdown', event => {
if (!active || hud.contains(event.target)) return;
pointers.add(event.pointerId);
if (pointers.size > 1) { setFit(settings().fullscreenFit === 'fill' ? 'fit' : 'fill'); pointers.clear(); return; }
const now = performance.now(), rect = stage.getBoundingClientRect();
const center = Math.abs(event.clientX - rect.left - rect.width / 2) < rect.width * .24 && Math.abs(event.clientY - rect.top - rect.height / 2) < rect.height * .24;
if (center && now - lastTap < 330) { setFit(settings().fullscreenFit === 'fill' ? 'fit' : 'fill'); lastTap = 0; }
else lastTap = center ? now : 0;
}, { passive: true });
stage.addEventListener('pointerup', event => pointers.delete(event.pointerId), { passive: true });
stage.addEventListener('pointercancel', event => pointers.delete(event.pointerId), { passive: true });
// Fit/Fill is only the HUD button: a centre double-tap is play/pause and two fingers pinch-zoom (app.js Gestures).
function layout() {
if (!active) return;
angle = custom ? rotation(settings().fullscreenOrientation, innerWidth, innerHeight) : 0;