izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Quickly zooming renders text upside-down #109

Closed hmarthinsen closed 8 years ago

hmarthinsen commented 8 years ago

If I zoom in or out quickly, e.g. by holding CTRL and scrolling the mouse wheel, sometimes the current page is rendered upside-down. Sometimes two pages are rendered on top of each other, one of them upside-down as well.

izuzak commented 8 years ago

Yep, I've definitely seen this myself many time. Would love to see it fixed, but I probably won't have time to work on it myself in the near future. If someone else want to try and fix this -- I'd be happy to review a pull request.

Thanks for opening an issue for this :heart:

BDMorrell commented 8 years ago

I recreated it, too. It works (or breaks) better on larger documents; especially, seemingly, with different fonts rendering on the same page, and complicated layouts. (My main document is mainly programming notes, but I don't think it would be wise if I share it. :unamused: sorry. If you want, I can try getting a screen shot of that with a bogus page; though it would take me a while.) I first found it when I accidentally scrolled and pressed control-0 to reset my zoom. I can reliably reproduce the image clones to have 4 at a time: 2 upside down, overlapping on some parts, 2 right side up, overlapping. I can tell it's redrawn twice because, in addition to me being able to see the new sections appear relatively slowly, (relative to expected computer speeds with native programs,) the double-drawn areas are bold. The pdf.js scripts seems to rework the HTML every time it is resized, and continues until finished. I think it's the HTML because I can scroll around whilst glitched (Even the other pages are glitched when this happens!) The problem here seems to be that on resize, nothing tells the previous pdf.js threads to stop; so they keep on going on. Though, I still don't know how it gets upside down, or why it seems like atom scales it strangely. I have a screen shot with basically a 47-page lorem document (I tried with 7-page version, this breaks better) with a slight amount of some sections and chapters. pdfbug Hope this helps!

izuzak commented 8 years ago

Thanks for providing feedback, @BDMorrell. Yeah, it's relatively easy to reproduce this, but I'm afraid I won't have time to work on thins anytime soon. If anyone else wants to try to fix this -- that'd be great and I'd be happy to help with a review. :+1:

lu-kas commented 8 years ago

Btw, this might be very related to issue #69