GithubHelp home page GithubHelp logo

Comments (7)

legimet avatar legimet commented on June 26, 2024

@critor intentionally made it that way, because it takes so long to load the next page, and it would be annoying if a user accidentally went to the next page. If you can come up with a better idea feel free.

from npdf.

davy39 avatar davy39 commented on June 26, 2024

Maybe it is related to the kind of PDF (heavy images, etc) because my pages (mostly text and math) are opening almost instantaneously. So I will be happy to have a complete scrolling mode:)
@critor : do you have any clue about why next(); is never called in my patch ? davy39@c6b3bce
Would you have any time to help implement this ?

from npdf.

critor avatar critor commented on June 26, 2024

What you apparently didn't understand, is that you're not going to get a "complete scrolling mode", but a terrible user experience.
Scrolling beyond the bottom of the page didn't scroll to the next page in a natural way.
It completely cleared the screen, putting you on the top of the next page.
So it's not natural to have some presses on the down-arrow key scrolling by a handful of pixels, and some other presses scrolling by a full screen height (240px).

Moreover, "almost instantaneously" is not "instantenously".
By letting its finger on the down-arrow key one fraction of a second too late, the user who just wanted to check the bottom of a page is going to be shown the next page, whose display is not instantaneous (almost a second).
So the user will then have to go back to the previous page (again, almost one more second), and then carefully scroll back to the bottom of the page.

from npdf.

davy39 avatar davy39 commented on June 26, 2024

I understand your point, and probably the user experience may depends both on hardware and PDF.
I'm actually using nspire cx cas overclocked with small text PDFs and I would say that pages are displaying with about 200ms which is really fine.

So in my case, I feel it more natural to explore a PDF by pressing one unique key than juggling between two ('down arrow' + '+'), even if it means some bigger steps while changing pages. In fact, that the way mupdf is acting when build for x11 (see here for code related to it).

You're absolutely right that it may be a really bad thing when it take so long to display, so I will not insist for it to be the default behaviour of nPDF. However, do you have an idea on why next() is never called when applying this simple patch davy39@c6b3bce

Finally, the best would of course be to achieve a "real" continuous scrolling mode (like in llpp ie. display both bottom of previous page and head of next one.). But I guess this implies a huge code modification, and I'm personally not ready for that yet...

from npdf.

critor avatar critor commented on June 26, 2024

Thank you for your fast and comprehensive reply.

Yes, the right way for a continuous scrolling with nPDF would be to show 2 pages at the same time : end of the previous page + start of the next page.

Your next() is never called, because yPos is automatically fixed each times it gets modified and thus is never out of bounds.

By the way Legimet, isn't there an error in Viewer.cpp on line 244 ?
Shouldn't
yPos = (xPos > (bounds.y1 - bounds.y0) - height)?(bounds.y1 - bounds.y0) - width:yPos;
be
yPos = (yPos > (bounds.y1 - bounds.y0) - height)?(bounds.y1 - bounds.y0) - width:yPos;
?

from npdf.

davy39 avatar davy39 commented on June 26, 2024

Thank you !

So stupid am I : I looked every where else but I didn't see that xPos in place of yPos... That's why nothing was working ;)
Now I'm happy, I got the scrolling mode I expected with this patch davy39@c7de00d

Maybe if you think it could be useful for others, we could integrate that as an option in a configuration file.

Anyway, many thanks to @critor and @legimet for your awesome work !

from npdf.

legimet avatar legimet commented on June 26, 2024

I fixed the error.

@davy39, a config option would be good. We could possibly allow 3 modes of scrolling: the current behavior, the behavior in your modified version, and a proper continuous scrolling mode.

from npdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.