This commit is contained in:
Vanessa 2023-12-07 12:33:52 +08:00
parent aa9c9b2f7c
commit b31765d0ab

View File

@ -553,12 +553,12 @@ const showHighlight = (selected: IPdfAnno, pdf: any, hl?: boolean) => {
if (!textLayerElement.lastElementChild) { if (!textLayerElement.lastElementChild) {
return; return;
} }
const viewport = page.viewport;
const viewport = page.viewport.clone({rotation: 0}); // rotation https://github.com/siyuan-note/siyuan/issues/9831
if (textLayerElement.lastElementChild.classList.contains("endOfContent")) { if (textLayerElement.lastElementChild.classList.contains("endOfContent")) {
textLayerElement.insertAdjacentHTML("beforeend", "<div></div>"); textLayerElement.insertAdjacentHTML("beforeend", "<div></div>");
} }
textLayerElement = textLayerElement.lastElementChild; textLayerElement = textLayerElement.lastElementChild;
let html = `<div class="pdf__rect popover__block" data-node-id="${selected.id}" data-mode="${selected.mode}">`; let html = `<div class="pdf__rect popover__block" data-node-id="${selected.id}" data-mode="${selected.mode}">`;
selected.coords.forEach((rect) => { selected.coords.forEach((rect) => {
const bounds = viewport.convertToViewportRectangle(rect); const bounds = viewport.convertToViewportRectangle(rect);