readium/r2-navigator-swift

Locaters that overlap on one page

ehapmgs opened this issue · 4 comments

Sometimes two locaters might overlap on a single page and when you use scrollToPosition function it will snap the the previous locater that the user will be already done with

Check out the videos for more details

without snapping the offset
without

with snapping to the previous page (current behaviour)

with

Please check #93 as a suggested solution that snap the offset to the next page instead

Potentially, you can have dozens of locators pointing to the same "screen"/"column" of content. Based on your videos, I guess that by "locator" you mean "position" right?

@HadrienGardeur The case is when you want the report to the user where is his progression in terms of positionList as you can see in the second gif for the first page the navigator will report that you are at position 55 and 56 for the second page but when you use go function with position 56 you will end up at position 55 the reason behind this that the progression for position 56 will end up between the two pages as you can see in the first gif and since snapOffset subtract from the offset the reminder you will end up at the previous page

OK thanks for the clarification.

We've mentioned aligning with RMSDK regarding how we calculate positions (1024 bytes), which means that it'll become even more likely to trigger what you describe.

That said, if you're on a column/screen that contains position 55, 56 and 57 (keep in mind that this is device and user settings specific, another user might only be at position 55), it would be incorrect to move to the next column if the user selects position 56.
We should avoid at all cost situation where the user gets stuck between two columns, but it's IMO best to jump to the start of any given position.

Thanks for the update, that would make more sense