Skip to content

Commit a8c7763

Browse files
authored
Merge pull request #19717 from calixteman/issue16287
Don't overwrite the global alpha when switching to smask mode (bug 1764587)
2 parents b57da32 + 1d0227a commit a8c7763

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/display/canvas.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,7 @@ class CanvasGraphics {
13231323
this.current.strokeAlpha = value;
13241324
break;
13251325
case "ca":
1326-
this.current.fillAlpha = value;
1327-
this.ctx.globalAlpha = value;
1326+
this.ctx.globalAlpha = this.current.fillAlpha = value;
13281327
break;
13291328
case "BM":
13301329
this.ctx.globalCompositeOperation = value;
@@ -1378,17 +1377,12 @@ class CanvasGraphics {
13781377
drawnHeight
13791378
);
13801379
this.suspendedCtx = this.ctx;
1381-
this.ctx = scratchCanvas.context;
1382-
const ctx = this.ctx;
1380+
const ctx = (this.ctx = scratchCanvas.context);
13831381
ctx.setTransform(this.suspendedCtx.getTransform());
13841382
copyCtxState(this.suspendedCtx, ctx);
13851383
mirrorContextOperations(ctx, this.suspendedCtx);
13861384

1387-
this.setGState([
1388-
["BM", "source-over"],
1389-
["ca", 1],
1390-
["CA", 1],
1391-
]);
1385+
this.setGState([["BM", "source-over"]]);
13921386
}
13931387

13941388
endSMaskMode() {

test/test_manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5821,8 +5821,7 @@
58215821
"file": "pdfs/issue16287.pdf",
58225822
"md5": "cd3e0859140465ae8b8bde0c95cb4929",
58235823
"rounds": 1,
5824-
"type": "eq",
5825-
"about": "Please note that this file currently renders incorrectly."
5824+
"type": "eq"
58265825
},
58275826
{
58285827
"id": "issue2006",

0 commit comments

Comments
 (0)