Description
On some books, when swiping through the content, the EPUB columns are shifting and are not aligned anymore. This reverts by tapping on the edges.
I could reproduce this on oryel_1984.zip from this issue: #167
Metadata
Metadata
Assignees
Labels
No labels
Activity
mickael-menu commentedon Aug 18, 2020
Another related issue, the columns are slightly shifting in long resources, such that the last page is not centered. For example with Gatsby:
[-]EPUB columns shift when swiping through a resource[/-][+]Various reflowable EPUB columns shift issues[/+]mickael-menu commentedon Aug 19, 2020
Another issue, I can move the offset of a page by pinching it, then panning it in a single gesture.

johanpoirier commentedon Sep 3, 2020
I also have issues with going to a locator with an anchor fragment (i.e.
Chapitre02.html#int02-s3
).The columns are shifted as well. Loading the webView with an URL containing an anchor is problematic. Is it CSS related?
nidhinprathap commentedon Sep 5, 2020
@johanpoirier there's a method that's javascript getting called but the definition is missing. Please check the below-mentioned ticket.
readium/r2-testapp-kotlin#351
For now, you can change tat and call scrollToTag method in utility.js
johanpoirier commentedon Sep 7, 2020
Yes I did see that and I used
scrollToId
method instead. But the behaviour is sometimes odd. When the URL has an anchor, the page displayed is the one before so I'm trying to debug the issue right now.nidhinprathap commentedon Sep 7, 2020
ah for that can u try this
@johanpoirier can you try this. Add this method to utils.js. And call scrollAnchor from Kotlin like this
johanpoirier commentedon Oct 27, 2020
This is caused by those lines of code: https://github.com/readium/r2-navigator-kotlin/blob/develop/r2-navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt#L735-L738
The
mLastMotionX
is set by the second finger down, so thexDiff
is almost never greater thanmTouchSlop
: https://github.com/readium/r2-navigator-kotlin/blob/develop/r2-navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt#L677My question is: why are we mixing touch pointers values into
mLastMotionX
?mickael-menu commentedon Nov 9, 2020
It looks like the offset issues are caused by some rendering bug in Android's Web View, but we have a potential workaround enabled by Readium CSS: readium/css#97
mickael-menu commentedon Nov 12, 2020
I pushed a PR which addresses the offset issue at least in my use cases, using the latest version of Readium CSS. I'm not 100% sure it fixes all of the reported offset issues.
readium/r2-navigator-kotlin#178
Note that
utils.js
is completely rewritten, to align with the Swift version. I didn't see any regression with RTL (which didn't work anyway in my tests) but something to keep in mind in case some other issues pop up.@johanpoirier
This should be fixed as well, would you mind double-checking with this PR?
johanpoirier commentedon Nov 13, 2020
thanks @mickael-menu , I'll test that next monday.
johanpoirier commentedon Nov 16, 2020
I just tested it on my own app and the r2-testapp but the offset issue is still present in this case.
I fixed it on my app a few weeks ago, I'll try to put the fix in a PR tomorrow.
mickael-menu commentedon Nov 16, 2020
Sounds good, might be that we're using different test cases. Thanks for taking a look!