mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +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
|
@ -284,6 +284,17 @@ class PDFPageView {
|
|||
this._container?.style.setProperty(
|
||||
"--hcm-highlight-filter",
|
||||
pdfPage.filterFactory.addHighlightHCMFilter(
|
||||
"highlight",
|
||||
"CanvasText",
|
||||
"Canvas",
|
||||
"HighlightText",
|
||||
"Highlight"
|
||||
)
|
||||
);
|
||||
this._container?.style.setProperty(
|
||||
"--hcm-highlight-selected-filter",
|
||||
pdfPage.filterFactory.addHighlightHCMFilter(
|
||||
"highlight_selected",
|
||||
"CanvasText",
|
||||
"Canvas",
|
||||
"HighlightText",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue