-
Notifications
You must be signed in to change notification settings - Fork 54
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
Implement synchronous horizontal scroll #111
base: master
Are you sure you want to change the base?
Conversation
4493228
to
25f1a56
Compare
@@ -138,6 +138,9 @@ class GlobalOptions( | |||
val isSwapKeys: Boolean | |||
get() = getBooleanProperty(SWAP_KEYS, false) | |||
|
|||
val isSyncXScroll: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhmylove here you use old Orion's approach to work with properties, it doesn't reflect changes in setting until application restart. Please take a look on DRAW_PAGE_BORDER property below, it defines OBSERVABLE property that listens all changes in settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll update this part of code soon
activePages.forEach { | ||
if (it.isOnScreen) { | ||
if (first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change in doScrollAndDoRendering
is clear, but this one is not. Could you please elaborate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed that orion-viewer does something like prefetch of the pages: it loads around 3 extra pages to the direction of scrolling and changes in doScrollAndDoRendering
properly sync their X-position.
The problem was with other pages being loaded during scrolling. I failed setting their X-position in uploadPrevPage
and uploadNextPage
, nor inside addPageInPosition
— those functions just ignored it and new pages (4+ pages below) got improper position. So the only solution I came across is to synchronize X-position for all the pages being rendered in renderVisiblePages
Addresses #102
Implemented new behaviour parameter: syncXScroll which is disabled by default.
When active, it synchronizes horizontal position of all active pages