Skip to content

Commit b339124

Browse files
committed
Conflicts
1 parent e31744e commit b339124

File tree

3 files changed

+1746
-1757
lines changed

3 files changed

+1746
-1757
lines changed

src/display/canvas.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -1059,10 +1059,6 @@ class CanvasGraphics {
10591059
// Vertical or horizontal scaling shall not be more than 2 to not lose the
10601060
// pixels during drawImage operation, painting on the temporary canvas(es)
10611061
// that are twice smaller in size.
1062-
1063-
// displayWidth and displayHeight are used for VideoFrame.
1064-
const width = img.width ?? img.displayWidth;
1065-
const height = img.height ?? img.displayHeight;
10661062
let widthScale = Math.max(
10671063
Math.hypot(inverseTransform[0], inverseTransform[1]),
10681064
1
@@ -1498,7 +1494,6 @@ class CanvasGraphics {
14981494
let maskY = layerOffsetY - maskOffsetY;
14991495

15001496
if (backdrop) {
1501-
const backdropRGB = Util.makeHexColor(...backdrop);
15021497
if (
15031498
maskX < 0 ||
15041499
maskY < 0 ||
@@ -1512,22 +1507,23 @@ class CanvasGraphics {
15121507
);
15131508
const ctx = canvas.context;
15141509
ctx.drawImage(maskCanvas, -maskX, -maskY);
1515-
ctx.globalCompositeOperation = "destination-atop";
1516-
ctx.fillStyle = backdropRGB;
1517-
ctx.fillRect(0, 0, width, height);
1518-
ctx.globalCompositeOperation = "source-over";
1519-
1510+
if (backdrop.some(c => c !== 0)) {
1511+
ctx.globalCompositeOperation = "destination-atop";
1512+
ctx.fillStyle = Util.makeHexColor(...backdrop);
1513+
ctx.fillRect(0, 0, width, height);
1514+
ctx.globalCompositeOperation = "source-over";
1515+
}
15201516
maskCanvas = canvas.canvas;
15211517
maskX = maskY = 0;
1522-
} else {
1518+
} else if (backdrop.some(c => c !== 0)) {
15231519
maskCtx.save();
15241520
maskCtx.globalAlpha = 1;
15251521
maskCtx.setTransform(1, 0, 0, 1, 0, 0);
15261522
const clip = new Path2D();
15271523
clip.rect(maskX, maskY, width, height);
15281524
maskCtx.clip(clip);
15291525
maskCtx.globalCompositeOperation = "destination-atop";
1530-
maskCtx.fillStyle = backdropRGB;
1526+
maskCtx.fillStyle = Util.makeHexColor(...backdrop);
15311527
maskCtx.fillRect(maskX, maskY, width, height);
15321528
maskCtx.restore();
15331529
}

test/test_manifest.json

-7
Original file line numberDiff line numberDiff line change
@@ -10734,12 +10734,5 @@
1073410734
"type": "eq",
1073510735
"link": true,
1073610736
"talos": false
10737-
},
10738-
{
10739-
"id": "issue18956",
10740-
"file": "pdfs/issue18956.pdf",
10741-
"md5": "73e8cd32bd063e42fcc4b270c78549b1",
10742-
"rounds": 1,
10743-
"type": "eq"
1074410737
}
1074510738
]

0 commit comments

Comments
 (0)