Touch gestures for fixed-layout: pinch-zoom, pan, swipe paging, double-tap

- Single finger: pan while zoomed; horizontal swipe pages at fit
  (direction mapped through next()/prev() so RTL manga reads
  correctly); drag on PDF text still defers to selection via the
  existing smart-detection (realTarget).
- Two fingers: pinch-zoom around the midpoint (through the shared
  zoom machinery, so PDF re-render scheduling works) plus
  midpoint-pan; lifts back to single-finger pan when one lifts.
- Double-tap: zoom 2.5x at the point / reset to fit.
- Touch events forwarded from page iframes with converted
  coordinates; preventDefault only when the engine actually consumes
  the gesture so native selection/taps stay intact.
- touch-action: none on :host and in comic/pdf page documents so the
  browser does not fight the gesture engine inside iframes.
This commit is contained in:
2026-08-14 15:54:00 -04:00
parent 29bc958c26
commit e9e61d885b
3 changed files with 263 additions and 4 deletions
+1
View File
@@ -100,6 +100,7 @@ const renderPage = async (page, getImageBlob) => {
html, body {
margin: 0;
padding: 0;
touch-action: none;
}
/*
https://github.com/mozilla/pdf.js/commit/bd05b255fabfc313b194bfe9a17ccded4d90fb5a