Skip to content

Commit

Permalink
Merge pull request #6292 from Snuffleupagus/issue-6287
Browse files Browse the repository at this point in the history
Fix various shading pattern regressions (issue 6287)
  • Loading branch information
timvandermeij committed Jul 31, 2015
2 parents 28130b9 + 1d65daf commit 72ecbec
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/core/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Shadings.Mesh = (function MeshClosure() {

var numComps = context.numComps;
this.tmpCompsBuf = new Float32Array(numComps);
var csNumComps = context.colorSpace;
var csNumComps = context.colorSpace.numComps;
this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) :
this.tmpCompsBuf;
}
Expand Down Expand Up @@ -345,13 +345,10 @@ Shadings.Mesh = (function MeshClosure() {

reader.align();
}

var psPacked = new Int32Array(ps);

mesh.figures.push({
type: 'triangles',
coords: psPacked,
colors: psPacked
coords: new Int32Array(ps),
colors: new Int32Array(ps),
});
}

Expand All @@ -366,13 +363,10 @@ Shadings.Mesh = (function MeshClosure() {
coords.push(coord);
colors.push(color);
}

var psPacked = new Int32Array(ps);

mesh.figures.push({
type: 'lattice',
coords: psPacked,
colors: psPacked,
coords: new Int32Array(ps),
colors: new Int32Array(ps),
verticesPerRow: verticesPerRow
});
}
Expand Down
2 changes: 2 additions & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
!simpletype3font.pdf
!sizes.pdf
!close-path-bug.pdf
!issue2948.pdf
!issue6231_1.pdf
!issue4630.pdf
!issue4909.pdf
!issue5202.pdf
Expand Down
Binary file added test/pdfs/issue2948.pdf
Binary file not shown.
Binary file added test/pdfs/issue6231_1.pdf
Binary file not shown.
14 changes: 14 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,20 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue2948",
"file": "pdfs/issue2948.pdf",
"md5": "26210bed6a57d5466042aff22f0249f0",
"link": false,
"rounds": 1,
"type": "eq"
},
{ "id": "issue6231_1",
"file": "pdfs/issue6231_1.pdf",
"md5": "eb13a9366a5142833a858472c68b4749",
"link": false,
"rounds": 1,
"type": "eq"
},
{ "id": "usmanm-bad-auto-fetch",
"file": "pdfs/usmanm-bad.pdf",
"md5": "38afb822433aaf07fc8f54807cd4f61a",
Expand Down

0 comments on commit 72ecbec

Please sign in to comment.