Skip to content

canGoForward is not reliable when viewing fixed-layout EPUBs in portrait mode #203

@TheUnlocked

Description

@TheUnlocked

I encountered this when trying to use https://github.com/edrlab/thorium-web and I don't know how to easily test it from this repository directly, but from what I can tell the root cause is from here.

To reproduce:

  1. Monitor canGoForward from EpubNavigator in some way (I did this in Thorium by adding a log statement in the wrapper function defined in useEpubNavigator).
  2. Open "Bella The Dragon" (included in the list of example e-books in Thorium).
  3. Progress through the book and monitor the value of canGoForward. Starting on page 15 (half-way through the book), it will start evaluating to false.

This seems to have to do with how FXLSpreader works, since it builds spreads in groups of two pages, but then identifies the current spread based on the page index in the spreads list. In landscape mode perPage is 2 which accounts for the fact that the page index is twice as large as the spread index, but in portrait mode perPage is 1. The (incorrect) current spread is then used by FXLFramePoolManager to build the viewport progressions list, which is in turn used to calculate canGoForward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions