From 2d70a3bc17fe94d0bf92d8362b8fda8a2e4a82e1 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 26 Jun 2025 16:41:01 -0400 Subject: fixed rendering pdfs, text selections on pdfs, --- src/client/views/pdf/PDFViewer.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/views/pdf/PDFViewer.tsx') diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 97fe183dd..bb4485712 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -443,10 +443,10 @@ export class PDFViewer extends ObservableReactComponent { const annoBox = document.createElement('div'); annoBox.className = 'marqueeAnnotator-annotationBox'; // transforms the positions from screen onto the pdf div - annoBox.style.left = (((rect.left - boundingRect.left) * scaleX) / pdfScale).toString(); - annoBox.style.top = (((rect.top - boundingRect.top) * scaleY) / pdfScale + this._mainCont.current.scrollTop).toString(); - annoBox.style.width = ((rect.width * scaleX) / pdfScale).toString(); - annoBox.style.height = ((rect.height * scaleY) / pdfScale).toString(); + annoBox.style.left = (((rect.left - boundingRect.left) * scaleX) / pdfScale).toString() + 'px'; + annoBox.style.top = (((rect.top - boundingRect.top) * scaleY) / pdfScale + this._mainCont.current.scrollTop).toString() + 'px'; + annoBox.style.width = ((rect.width * scaleX) / pdfScale).toString() + 'px'; + annoBox.style.height = ((rect.height * scaleY) / pdfScale).toString() + 'px'; this._annotationLayer.current && MarqueeAnnotator.previewNewAnnotation(this._savedAnnotations, this._annotationLayer.current, annoBox, this.getPageFromScroll(rect.top)); } } -- cgit v1.2.3-70-g09d2