Browse Source

Merge pull request #6292 from Snuffleupagus/issue-6287

Fix various shading pattern regressions (issue 6287)
Tim van der Meij 10 years ago
parent
commit
72ecbec49d
  1. 16
      src/core/pattern.js
  2. 2
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/issue2948.pdf
  4. BIN
      test/pdfs/issue6231_1.pdf
  5. 14
      test/test_manifest.json

16
src/core/pattern.js

@ -225,7 +225,7 @@ Shadings.Mesh = (function MeshClosure() {
var numComps = context.numComps; var numComps = context.numComps;
this.tmpCompsBuf = new Float32Array(numComps); this.tmpCompsBuf = new Float32Array(numComps);
var csNumComps = context.colorSpace; var csNumComps = context.colorSpace.numComps;
this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) :
this.tmpCompsBuf; this.tmpCompsBuf;
} }
@ -345,13 +345,10 @@ Shadings.Mesh = (function MeshClosure() {
reader.align(); reader.align();
} }
var psPacked = new Int32Array(ps);
mesh.figures.push({ mesh.figures.push({
type: 'triangles', type: 'triangles',
coords: psPacked, coords: new Int32Array(ps),
colors: psPacked colors: new Int32Array(ps),
}); });
} }
@ -366,13 +363,10 @@ Shadings.Mesh = (function MeshClosure() {
coords.push(coord); coords.push(coord);
colors.push(color); colors.push(color);
} }
var psPacked = new Int32Array(ps);
mesh.figures.push({ mesh.figures.push({
type: 'lattice', type: 'lattice',
coords: psPacked, coords: new Int32Array(ps),
colors: psPacked, colors: new Int32Array(ps),
verticesPerRow: verticesPerRow verticesPerRow: verticesPerRow
}); });
} }

2
test/pdfs/.gitignore vendored

@ -22,6 +22,8 @@
!simpletype3font.pdf !simpletype3font.pdf
!sizes.pdf !sizes.pdf
!close-path-bug.pdf !close-path-bug.pdf
!issue2948.pdf
!issue6231_1.pdf
!issue4630.pdf !issue4630.pdf
!issue4909.pdf !issue4909.pdf
!issue5202.pdf !issue5202.pdf

BIN
test/pdfs/issue2948.pdf

Binary file not shown.

BIN
test/pdfs/issue6231_1.pdf

Binary file not shown.

14
test/test_manifest.json

@ -634,6 +634,20 @@
"rounds": 1, "rounds": 1,
"type": "eq" "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", { "id": "usmanm-bad-auto-fetch",
"file": "pdfs/usmanm-bad.pdf", "file": "pdfs/usmanm-bad.pdf",
"md5": "38afb822433aaf07fc8f54807cd4f61a", "md5": "38afb822433aaf07fc8f54807cd4f61a",

Loading…
Cancel
Save