readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
223 stars 96 forks source link

Wrong position after rotation #344

Closed RomanSoviak closed 8 months ago

RomanSoviak commented 8 months ago

https://github.com/readium/swift-toolkit/assets/26696190/b1fd9870-b9d5-40cb-bca9-92557f830704

https://github.com/readium/swift-toolkit/assets/26696190/24a40aa0-fc74-4fd1-ae4e-c6ee341a4bff

RomanSoviak commented 8 months ago

hi @mickael-menu, as you recommended in Slack I provide more details/steps for reproducing this bug:

  1. I downloaded the app from here: https://testflight.apple.com/join/lYEMEfBr
  2. Opened OPDS catalogue and fetched the first book image
  3. Then I went to the library and opened book. After some rotations position was shifted to the start of the chapter: https://github.com/readium/swift-toolkit/assets/26696190/4ce9d407-ece5-4250-8994-27d6616bd7ed
  4. This bug was reported by our user on the tablet. https://github.com/readium/swift-toolkit/assets/26696190/fb681c19-5779-4628-b039-38f320b912c3 This book has one big chapter and it's uncomfortable when position changed from 57/281 to the 1/281. Could you please help with that. Should we store locator somewhere and after this rotations use it? Or what should we do in cases like that? Thanks in advance🙂
mickael-menu commented 8 months ago

There are two different issues:

  1. When you rotate several times the screen, the position is progressively moving backwards. This is expected and a current limitation of the toolkit, because we restore the web view progression instead of an exact location in the HTML resource. This should not be an issue for your users though.
  2. If you rotate the screen two times too fast (before the chapter has the opportunity of rendering), then we loose the current location and end up at the beginning of the current chapter. This is a bug that needs to be fixed in Readium, there's nothing to do in your app.
mickael-menu commented 8 months ago

@RomanSoviak Could you check that this PR solves the problem for you? https://github.com/readium/swift-toolkit/pull/347

RomanSoviak commented 8 months ago

It works! Thanks a lot! Do you plan to release a new version with that update? @mickael-menu

mickael-menu commented 8 months ago

Yes I'll do a patch release after this other PR is solved: https://github.com/readium/swift-toolkit/pull/349