1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Avoid to have a white line around the canvas

The canvas must have the same dims as the page in order to avoid to see the page
background.
This commit is contained in:
Calixte Denizet 2024-09-05 17:05:22 +02:00
parent 77c7ec6927
commit 68332ec236
8 changed files with 146 additions and 7 deletions

View file

@ -1103,8 +1103,12 @@ function setLayerDimensions(
const w = `var(--scale-factor) * ${pageWidth}px`,
h = `var(--scale-factor) * ${pageHeight}px`;
const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,
heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;
const widthStr = useRound
? `round(down, ${w}, var(--scale-round-x, 1px))`
: `calc(${w})`,
heightStr = useRound
? `round(down, ${h}, var(--scale-round-y, 1px))`
: `calc(${h})`;
if (!mustFlip || viewport.rotation % 180 === 0) {
style.width = widthStr;