Fix the annotation base transform before drawing it

It fixes #7821.

We do something similar for before drawing XObjects.
This commit is contained in:
Calixte Denizet 2026-04-01 13:10:24 +02:00 committed by calixteman
parent f05bad9872
commit 9ed5eef6d7
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
4 changed files with 11 additions and 0 deletions

View File

@ -2858,8 +2858,10 @@ class CanvasGraphics {
this.ctx.canvas.height
);
this.baseTransformStack.push(this.baseTransform);
this.transform(opIdx, ...transform);
this.transform(opIdx, ...matrix);
this.baseTransform = getCurrentTransform(this.ctx);
}
endAnnotation(opIdx) {
@ -2871,6 +2873,7 @@ class CanvasGraphics {
delete this.annotationCanvas.savedCtx;
delete this.annotationCanvas;
}
this.baseTransform = this.baseTransformStack.pop();
}
paintImageMaskXObject(opIdx, img) {

View File

@ -897,3 +897,4 @@
!tiling_patterns_variations.pdf
!function_based_shading.pdf
!issue16091.pdf
!issue7821.pdf

BIN
test/pdfs/issue7821.pdf Executable file

Binary file not shown.

View File

@ -14059,5 +14059,12 @@
"md5": "ac6b2b69d9b3675b317708ec00aaf56c",
"rounds": 1,
"type": "eq"
},
{
"id": "issue7821",
"file": "pdfs/issue7821.pdf",
"md5": "7f0f390a70228fffe95835518ec266c5",
"rounds": 1,
"type": "eq"
}
]