johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.35k stars 291 forks source link

wrong page turn animation #1084

Open kaptem opened 1 year ago

kaptem commented 1 year ago

Describe the bug A clear and concise description of what the bug is. Page animation moves in opposite direction as it should on some books. To Reproduce Steps to reproduce the behavior:

  1. Open a book that triggers this behavior
  2. Turning page on some books will have the animation go left instead of right when you are progressing through book. Occurs even after purging styles with Calibre.

Expected behavior Correct page turn behavior, and if it is to obscure, a way to disable page turn animations.

Version:

johnfactotum commented 1 year ago

The animation direction only follows the direction of the content document, and ignores the page progression direction. This is a limitation of CSS multicol, as there's no way of laying out columns in a different direction from the text. So if the content is RTL or vertical-rl, you should explicitly set dir="rtl" or writing-mode: vertical-rl. If that's missing, currently it will try to set the direction based on the direction of the language of the book, though it doesn't set writing-mode for you for CJK books with RTL page progression.

I guess another option would be to just force the text direction as the same as the page progression direction. And maybe force writing mode for CJK. But it would be best to avoid this, as it would only encourage people to not set the direction correctly for their books.

The ability to disable the animation should be added regardless of whether the animation is correct or not.