diff --git a/src/display/canvas.js b/src/display/canvas.js index f63d030a2..772b3cbe4 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1368,11 +1368,12 @@ class CanvasGraphics { // In case we've a pattern fill we just keep the scaled version of // the image. // Only the scaling part matters, the translation part is just used - // to compute offsets. + // to compute offsets (but not when filling patterns see #15573). // TODO: handle the case of a pattern fill if it's possible. - const withoutTranslation = currentTransform.slice(0, 4); cacheKey = JSON.stringify( - isPatternFill ? withoutTranslation : [withoutTranslation, fillColor] + isPatternFill + ? currentTransform + : [currentTransform.slice(0, 4), fillColor] ); cache = this._cachedBitmapsMap.get(mainKey); diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index a9f18fd0f..047f06317 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -544,3 +544,4 @@ !tracemonkey_a11y.pdf !bug1782564.pdf !issue15340.pdf +!bug1795263.pdf diff --git a/test/pdfs/bug1795263.pdf b/test/pdfs/bug1795263.pdf new file mode 100644 index 000000000..edd98d874 Binary files /dev/null and b/test/pdfs/bug1795263.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 2d2215b39..55b5a0e6f 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -6926,5 +6926,11 @@ "link": true, "rounds": 1, "type": "eq" + }, + { "id": "bug1795263", + "file": "pdfs/bug1795263.pdf", + "md5": "af708acbb22c6c9d268240dcf4a39809", + "rounds": 1, + "type": "eq" } ]