Zoom position resets in book view when switching PDFs
Hi there, please see video attached. In book view mode for ANY pdf, when you zoom in onto the right page:
- with the center column off-screen,
- and a high enough zoom-level that there is still space to scroll right,
the page shift to the furthest right it can when switching PDFs. I've tested this with a couple PDFs and they all exhibit this behaviour, it's quite frustrating when I need to switch back and forth and the position is different.
Not sure if that's what you see but I got the following to reproduce:
- open pdf,
Ctrl + 8, zoom really big, scroll right so that only second page is visible but not y-scrolled to the end - switch to home tab
- switch back to pdf tab
Another way to repro is: close and re-open to restore state.
The page will be scrolled all the way to the right. Also Happens in Ctrl + 7.
Looks like dm->GetScrollState() doesn't return the right page / scroll position or SetScrollState() doesn't restore it properly.
Pretty sure the problem is: newPt.x += viewPort.x; in DisplayModel::SetScrollState.
It doesn't take into account 2-page layout. Should subtract the width of previous page.