Merge 687c91d4e204f4102ca7ea4d11fe421a4f38e6e1 into 520363b350648ea066b4bd6b3d5697398a7e4096

This commit is contained in:
Jonas Jenwald 2025-10-28 04:42:22 +08:00 committed by GitHub
commit bb7837f140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1599,15 +1599,14 @@ class PDFViewer {
height = 0,
widthScale,
heightScale;
const changeOrientation = pageView.rotation % 180 !== 0;
const pageWidth =
(changeOrientation ? pageView.height : pageView.width) /
pageView.scale /
PixelsPerInch.PDF_TO_CSS_UNITS;
const pageHeight =
(changeOrientation ? pageView.width : pageView.height) /
pageView.scale /
PixelsPerInch.PDF_TO_CSS_UNITS;
// Utilize the viewport "end-points" rather than the effective width/height
// to avoid problems in PDF documents where the viewport starts at non-zero
// coordinates (fixes bug 1913617).
// NOTE: In the majority of PDF documents those values agree anyway.
const { viewBox } = pageView.viewport;
const changeOrientation = pageView.rotation % 180 !== 0,
pageWidth = changeOrientation ? viewBox[3] : viewBox[2],
pageHeight = changeOrientation ? viewBox[2] : viewBox[3];
let scale = 0;
switch (destArray[1].name) {
case "XYZ":