-
Notifications
You must be signed in to change notification settings - Fork 119
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
Navigator.go
results in misaligned view
#449
Comments
Do you have a way to reproduce this problem in the Test App, maybe after applying some code patch? |
I'm having trouble reproducing this in the Test App. Would it be okay to zip up my project and send it to you privately? |
Unfortunately I can't spend time debugging individual projects. In your screencast the navigator is not spanning the whole screen, I wonder if that could have an impact on this bug? |
It's totally understanding that you can't debug individual projects. I just assumed that this was a bug in swift-toolkit, not specifically in my implementation. The code I'm using is pretty much directly pulled from this documentation and I am not doing anything else to limit the width of the display, just the height. If it is a bug in swift-toolkit, I believe the reason I am unable to replicate it is due to:
One thing which does work around this issue is setting |
We can see left and right margins around the navigator in your video. I wonder if you have the same issue if you remove them.
Did you try to compile it after running
Not at the moment, but that could be an |
You're right! I didn't realize that I had done that. And you're also right about that causing this issue. Thanks! Is there an easy way for me to add horizontal padding in Test App to attempt to reproduce this?
I did not and that fixed it. Thanks. Looks like I didn't read the README very thoroughly. My mistake.
Even though this is no longer my top priority, I would be interested in this at some future point. If you point me in the right direction as to how to implement this, I will try to get to it eventually. |
You might be able to do it here: swift-toolkit/TestApp/Sources/Reader/Common/VisualReaderViewController.swift Lines 60 to 61 in 024fdc0
You're not the only one, I'll see if we can't have a guard in the makefile to check this 😄
That would be in the JavaScript layer, every time
Take a look at this guide if you want to modify the JavaScript files: https://github.com/readium/swift-toolkit/blob/develop/CONTRIBUTING.md#modifying-the-epub-navigators-javascript-layer |
That's it! To reproduce the issue, change the code like this: - navigator.view.frame = view.bounds
+ let padding: CGFloat = 25
+ navigator.view.frame = CGRect(x: view.bounds.origin.x + padding, y: view.bounds.origin.y, width: view.bounds.width - 2 * padding, height: view.bounds.height) Then add some bookmarks at various places and navigate directly to them. It seems like bookmarks on the first page of a chapter will display correctly while others will be cut off. |
Actually, this is possible to replicate without modifying the Test App. If you open it in an iPad or Mac you can resize the window and that will cause navigating to arbitrary bookmarks to break. I just reproduced this on unmodified |
Describe the bug
I'm synchronizing EPUB location and decoration with audiobook narration and finding that using
go
on the EPUB navigator can result in a view that is not center aligned and is therefore cut off. As one navigates through the cut off view, the view can quickly swap back and forth between the two sides of the cut page. However, swiping causes the pages to transition correctly. I'm attaching a screen recording below showing the correct swiping behavior followed by the cut offgo
behavior.RPReplay_Final1717532314.mov
How to reproduce?
go
to navigate to locators currently displaying or about to display on the next pageThough not the same EPUB as in the video, I also noticed the issue using this one (zipped because GitHub won't permit EPUB upload): 2 B R 0 2 B.epub.zip
Readium version
develop 8fad4d5
OS version
iOS 17.5.1
Testing device
iPhone 11 (also noticing it in simulator)
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: