TilingPattern: Reverse transform after painting

This transform resulted in an incorrectly positioned object when the
bounding box's upper-left corner did not start at (0,0), because
the translation was not reverted. This patch adds the missing transform.

The test file (tiling-pattern-box.pdf) is based on the PDF from #2825.
All but the first cube (including the PDF data) have been removed.
To trigger the bug that is fixed by this commit, I changed the BBox of
the first pattern from "[ 0 0 596 842]" to "[90 0 596 842]". Without
this patch, the dashed vertical line that intersects the corners at A
and E would disappear.
This commit is contained in:
Rob Wu 2015-11-07 15:02:37 +01:00
parent a72a8e921f
commit d3dc8f16b5
4 changed files with 2165 additions and 0 deletions

View File

@ -364,6 +364,8 @@ var TilingPattern = (function TilingPatternClosure() {
graphics.executeOperatorList(operatorList);
this.ctx.transform(1, 0, 0, 1, x0, y0);
// Rescale canvas so that the ctx.createPattern call generates a pattern
// with the desired size.
this.ctx.scale(1 / dimx.scale, 1 / dimy.scale);

View File

@ -340,4 +340,5 @@
!issue9972-1.pdf
!issue9972-2.pdf
!issue9972-3.pdf
!tiling-pattern-box.pdf
!tiling-pattern-large-steps.pdf

File diff suppressed because it is too large Load Diff

View File

@ -2996,6 +2996,14 @@
"link": false,
"type": "eq"
},
{
"id": "tiling-pattern-box",
"file": "pdfs/tiling-pattern-box.pdf",
"md5": "09100872824fc14012bd8f9bf4dbc632",
"rounds": 1,
"link": false,
"type": "eq"
},
{
"id": "tiling-pattern-large-steps",
"file": "pdfs/tiling-pattern-large-steps.pdf",