diff --git a/package.json b/package.json index 90b5625..cc8d5de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foliate-js", - "version": "0.5.3", + "version": "0.5.4", "description": "Render e-books in the browser", "repository": { "type": "git", diff --git a/paginator.js b/paginator.js index f2389eb..f246d2f 100644 --- a/paginator.js +++ b/paginator.js @@ -986,7 +986,14 @@ export class Paginator extends HTMLElement { const state = this.#touchState if (state.pinched) return state.pinched = globalThis.visualViewport.scale > 1 - if (this.scrolled || state.pinched) return + // Scrolled layouts (webtoon) scroll MANUALLY, like paginated ones: + // the browser's native touch scrolling — and its fling momentum — + // is suppressed so the full gesture stream stays observable to + // hosts (the reader classifies vertical flicks as chrome-reveal). + // Momentum is deliberately absent: drags are 1:1 and stop dead on + // release (no snap — webtoon panels don't align to screen + // boundaries); long jumps go through the reader's position UI. + if (state.pinched) return if (this.#touchSelActive) return if (e.touches.length > 1) { if (this.#touchScrolled) e.preventDefault() @@ -1008,11 +1015,14 @@ export class Paginator extends HTMLElement { #onTouchEnd() { const wasScrolled = this.#touchScrolled this.#touchScrolled = false - if (this.scrolled || this.#touchSelActive) return + if (this.#touchSelActive) return // A touch that never panned (a tap) is already page-aligned; // snapping anyway emits a no-op relocate, which readers treat // as a page turn (e.g. dismissing a just-opened popover). if (!wasScrolled) return + // No velocity paging in scrolled layouts: content stays exactly + // where released. + if (this.scrolled) return // XXX: Firefox seems to report scale as 1... sometimes...? // at this point I'm basically throwing `requestAnimationFrame` at