Conversation
Recently I started noticing that pages can have AnnotationEditorLayers *even* when their canvas is discarded, so... that's that. #pdfjsQuirks
Those highlights can be a bit brighter when there is no text underneath.
This is a major overhaul of both SVG and non-SVG annotation handling.
The patch achieves the following things:
* fully seperate add-on logic from core by moving the remaining viewer
related code from `lib/` to `app/`, completing the work of 7b0c8de;
* generalise SVG annotation handling and correctly recolor ink (draw)
annotations in PDF.js 4.9+, as they have now been made SVG as well;
* better reassign various parts of annotations event handling to the
different modules; and
* rename, reorder and clean up the `annots.js` functions and exports.
This refactor should also finally enable *doq* lib users to theme PDF.js
annotations in non-viewer environments, as they can pass the appropriate
container elements to the exported functions of `annots.js`.
Instead of drawing the mask on the canvas and waiting for PDF.js, we can directly blend the image with the mask and return the result for drawing with the normal source-over. This is logically simpler and less prone to breaking with complicated multi-image arrangements (sometimes found for title decorations in books). This also calls for some apt renamings.
Like 89a6f95; since canvas gradients and patterns are currently left off from interpolation, we need to test against backgrounds containing them.
Apparently, this can happen in normal PDFs and PDF.js still proceeds to render them, so... that's that. #pdfjsQuirks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19.