Issues with two page mode
I noticed 2 issues with two page mode on mac using the dev branch:
- Using next_page and previous_page in one page mode works as expected, the file moves exactly one full page. In two page mode, moving down one page moves too little, and moving up one page moves too much (same amount moved), so if I align the page to the border, and move one page down, the border moves down as well, and I start to be able to see the two pages above as well.
- Using open_last_document in one page mode works as expected, and it remembers the place where you were before in that file. In two page mode, it still maintains the same page, but it moves the view to the side (the position might correspond to where sioyek was opened first), although it fixed itself if you move up or down immediately, but the issue persists if you again using open_last_document.
Hi @tr1maksim, my pull request #1420 should fix these issues. Could you check that it fixes them on your end?
These should be fixed in the latest commits.
Hi @ahrm, at least for me this doesn't quite fix the issue if the first document was in single page mode. There's an off-by-one error somewhere as the original zoom / offsets are applied to the n+1th page instead of the nth. E.g. if I leave off reading at page 1 and come back, I'll be zoomed in the same way but to page 2 instead.
You mean when restarting sioyek or when using open_last_document?
When using open_last_document. I think the problem is the page offset from two page mode so reopening wouldn't cause a problem unless you messed with the configs between restarts.
You mean the very first time that you execute open_last_document? or does it happen every time? If you mean the first time then it is not really a big deal, I assume the user wants to do some adjustments to the zoom level after entering the two page mode anyway, the reason this happens is because the previous zoom level is adjusted for the single page mode so with the new two page mode it might look incorrect, but once the user adjusts the view it should work fine. Maybe in the future versions of sioyek I will store the two page mode-ness in the view state so this workaround is not necessary but for now I think this is good enough.
Every time. Set zoom in single page mode, switch documents, enable two page mode, and then go back either with open_last_document or prev_state etc. How I get there doesn't seem to make any difference. Some documents open to one page before the last visited page, others one page after. I think that's possibly related to which side the odd/even pages are displayed on.
Can you share a video of the problem? I am not sure if I understand correctly.
Hope that helps. Basically switching to two page mode and going back to a document that was in single page mode when last opened causes issues.
That video is horrible XD. If anything I am more confused now.
Hope that helps. Basically switching to two page mode and going back to a document that was in single page mode when last opened causes issues.
Yes, it does for me too but when I readjust the second document then subsequent open_last_document work fine. Or do mean you keep switching to one page mode in the second document?
No once you readjust switching between them works fine. It's only a problem when your current document is in two page mode and you switch back to one that was in single page mode.
Ah, that is not supported currently. Hopefully in a future version of sioyek I will support per-document two-pagedness so these issues hopefully will be resolved.
Yeah that would be good. I think a couple of features would be better with per-document settings (indexing, two_page and the recto-verso adjustment etc.) Not sure how much work it would take to implement all that though. Just weird more than anything since the zoom is applied, just to an adjacent page. That's partly why my initial solution just blindly fit to page width. But can work around it easily for now.