-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Refactor the thumbnail code #5673
Refactor the thumbnail code #5673
Conversation
Also updates a couple of the JSDoc comments.
Review progress:
|
/** | ||
* @typedef {Object} PDFThumbnailViewOptions | ||
* @property {HTMLDivElement} container - The viewer element. | ||
* @property {number} id - The thumbnail unique ID (normally its number). |
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.
Nit: The thumbnail_'s_ unique ID
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.
Fixed.
This includes an optimization to zero the height and width of existing thumbnail canvases, when they are removed and recreated during rotation of the document. (Credit goes to nnethercote, who initially found this in PR 4920.)
This is useful if thumbnails are being rendered when the document is rotated, since it let us abort the current rendering.
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/2c4a232f9f32c32/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/2c4a232f9f32c32/output.txt Total script time: 0.79 mins Published |
file and symbols dependencies look good |
Refactor the thumbnail code
Awesome work! |
Refactor the thumbnail code
This PR rewrites part of the thumbnail code to achieve the following goals:
ThumbnailView
implementation to be class-like.ThumbnailView
code to be more in-line with the correspondingPage
code. (Even though thePage
code has evolved quite a bit, theThumbnail
code hasn't usually followed suite.)To actually make it feasible to review this, I've divided the PR into multiple patches. The commit messages should hopefully be clear enough to explain what is going on. Also, for some of the larger patches, using the
?w=1
URL flag should help.I've made sure that at every point in the patch series, the code actually works. However, before landing this, I'm assuming that we might want to merge a few of the (smaller) commits together. But in order to make it somewhat easier to deal with any (hopefully non-existent) regressions, landing this as one big patch is probably not the best idea.