Welcome to the forum, Guest

TOPIC: A Different Page Advance Distance

A Different Page Advance Distance 4 years 11 months ago #4559

jockohomo

Offline

Fresh Boarder

Posts: 4

Karma: 0

When using YACReader, the distance that it advances a page (when I touch the screen) is uneven. With my iPad in landscape mode, when the page advances from the top, it moves a certain distance but when you continue to advance with the next tap, the screen only advances maybe half as much. That is to say, screen jump is quite large while the second one is rather small.

Even worse, if you advance from some random somewhere in the middle, you can get advanced to very near the bottom so that a subsequent tap will only advance you a couple of image lines, making you wonder why it didn't just move to the bottom of the screen to begin with.

It appears that the amount you advance the page with a tap is constant and doesn't change at all despite the context of the page view. I think this can be improved.

I think a better algorithm would be to split the page up into N views (I would default N to 3) and always advance the screen an even amount, that amount depending on which of the N views the current position is closest to. I can write pseudocode to demonstrate the algorithm but, for now, I'll simply try to describe it in detail, in English.

For example, if you start from the top, you would take the difference between the bottom of the current view (from the top) and divide it by 2 and that would be the amount you advance the page (when tapped). That way, if you were to progress the screen two times (giving three views of the page), the three views of the screen will be offset the same amount (an even amount).

If you were to manually move the page view some amount down the page, you would determine which of the N predetermined views the current view is closest to and use that to calculate the number of page advances to split the remaining distance of the page. For example, if the view were moved just a little bit down so the closest predetermined view is still the top view, you would simply do the same above calculation of dividing the rest of the page distance from the current view by 2 (to split the page into 3 views). However, if you manually moved the view by enough so that it's actually closer to the middle view than the top view, you'd then divide the distance by 1 ie simply move the view to the bottom of the page. This algorithm might sound funny in this case but that's only because the default is 3. If it were some higher number, you'd see the generalization...

Please let me know if this is understandable. Again, I can post pseudocode to explain in great detail what I mean. The ultimate demonstration, of course, would be to simply modify the source code for YACReader and show you how it works and you (or any testers) can decide if it's an improvement. However, I'm guessing that the source code for the iOS app isn't open sourced for a reason...

Thank you!
The administrator has disabled public write access.

A Different Page Advance Distance 4 years 10 months ago #4585

Luis Ángel

Offline

Administrator

Posts: 2616

Thank you received: 543

Karma: 22

Thanks for the suggestion. Yeah, the algorithm can be improved, now it takes into consideration the page and screen sizes and tries to guess the best steps sequence.

I will probably update how it works after adding double page mode support....
Contribute to the project becoming a patron: www.patreon.com/yacreader
You can also donate via Pay-Pal: www.paypal.com/donate?business=5TAMNQCDD...e=Support+YACReader\
The administrator has disabled public write access.
Powered by Kunena Forum