Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing window resets current position #152

Closed
OlegSmelov opened this issue Jul 29, 2019 · 2 comments
Closed

Resizing window resets current position #152

OlegSmelov opened this issue Jul 29, 2019 · 2 comments
Labels
bug Something isn't working epub.js Related to Epub.js

Comments

@OlegSmelov
Copy link

Watch the progress bar at the bottom when window is being resized:

foliate

I'd expect the first line on the left page to stay the same when resized.

Foliate 1.5.3
Ubuntu 18.04.2
Used the package from https://github.com/johnfactotum/foliate/releases/tag/1.5.3

@johnfactotum
Copy link
Owner

johnfactotum commented Jul 29, 2019

It does try to stay on the same page after resizing, however if you then resize it again, it would try to stay on the page that you were on after—not before—your first resize.

For example:

  1. Say you're at the 10th paragraph of a chapter.
  2. You then resize it, making the window bigger.
  3. It stays on the same page, in the sense that it would display the page that includes the start of the 10th paragraph. But, your location is now no longer on the 10th paragraph! Your location might now be at, for example, the 7th paragraph, because the window is big enough to display paragraph 7 to 10.
  4. And now you resize it again. It tries to stay at the same location, but this "same location" now means paragraph 7, not your original location.

This is Epub.js's normal behavior and I'm not sure if there's anything I can do to improve it. There's a related upstream PR here: futurepress/epub.js#959

Edit: you say that you'd "expect the first line on the left page to stay the same when resized." This is not possible. Because the start of a chapter will always be rendered as a first line on its page, and so the first line of every page would change from every resize. The best one can do is to display the page that includes the first line before the resize.

@johnfactotum johnfactotum added bug Something isn't working epub.js Related to Epub.js labels Jul 29, 2019
@HaasJona
Copy link

A workaround might be store the current reading position only when manually switching pages and so on, not when resizing. So if you do multiple resizes in a row, always try to restore the original reading position and not the reading position that appeared after the previous resize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epub.js Related to Epub.js
Projects
None yet
Development

No branches or pull requests

3 participants