Skip to content

Commit

Permalink
Merge pull request #6640 from dsprenkels/issue-6006-radial-gradient-size
Browse files Browse the repository at this point in the history
Apply transformation matrix to RadialGradient radiuses
  • Loading branch information
yurydelendik committed Nov 17, 2015
2 parents d000f03 + 6ce83d3 commit 2f1a626
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
if (matrix) {
p0 = Util.applyTransform(p0, matrix);
p1 = Util.applyTransform(p1, matrix);
if (shadingType === ShadingType.RADIAL) {
var scale = Util.singularValueDecompose2dScale(matrix);
r0 *= scale[0];
r1 *= scale[1];
}
}

return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1];
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
!bug1157493.pdf
!pdfjsbad1586.pdf
!freeculture.pdf
!issue6006.pdf
!pdfkit_compressed.pdf
!TAMReview.pdf
!pr4922.pdf
Expand Down
Binary file added test/pdfs/issue6006.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,13 @@
"link": true,
"type": "eq"
},
{
"id": "issue6006",
"file": "pdfs/issue6006.pdf",
"md5": "65558dcdd2f20d4372458419c10bfa72",
"rounds": 1,
"type": "eq"
},
{ "id": "issue1810",
"file": "pdfs/issue1810.pdf",
"md5": "b173a9dfb7bf00e1a298c6e8cb95c03e",
Expand Down

0 comments on commit 2f1a626

Please sign in to comment.