mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Make the caret visible in the text layer in caret browsing mode
In order to do that we must change the text layer opacity to 1 but it has several implications: - the selection color must have an alpha component, - the background color of the span used for highlighted words must have an alpha component either, but now the opacity is 1 we can use some backdrop-filters in HCM making the highlighted words more visible. - fix a regression caused by #17196: the css variable --hcm-highlight-filter has to live under the #viewer element because in HCM it's overwritten by js at this level, hence links annotations for example didn't have the right colors when hovered.
This commit is contained in:
parent
1cdbcfef82
commit
83c78dbfa8
7 changed files with 96 additions and 42 deletions
|
@ -884,12 +884,23 @@ class PDFViewer {
|
|||
this.viewer.style.setProperty(
|
||||
"--hcm-highlight-filter",
|
||||
pdfDocument.filterFactory.addHighlightHCMFilter(
|
||||
"highlight",
|
||||
"CanvasText",
|
||||
"Canvas",
|
||||
"HighlightText",
|
||||
"Highlight"
|
||||
)
|
||||
);
|
||||
this.viewer.style.setProperty(
|
||||
"--hcm-highlight-selected-filter",
|
||||
pdfDocument.filterFactory.addHighlightHCMFilter(
|
||||
"highlight_selected",
|
||||
"CanvasText",
|
||||
"Canvas",
|
||||
"HighlightText",
|
||||
"ButtonText"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue