Fixes function array support for radial/axial pattern
This commit is contained in:
parent
80f8f51b8d
commit
2c87a6467b
@ -115,11 +115,29 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
||||
this.extendEnd = extendEnd;
|
||||
|
||||
var fnObj = dict.get('Function');
|
||||
if (isArray(fnObj))
|
||||
error('No support for array of functions');
|
||||
if (!isPDFFunction(fnObj))
|
||||
error('Invalid function');
|
||||
var fn = PDFFunction.parse(xref, fnObj);
|
||||
var fn;
|
||||
if (isArray(fnObj)) {
|
||||
var fnArray = [];
|
||||
for (var j = 0, jj = fnObj.length; j < jj; j++) {
|
||||
var obj = xref.fetchIfRef(fnObj[j]);
|
||||
if (!isPDFFunction(obj)) {
|
||||
error('Invalid function');
|
||||
}
|
||||
fnArray.push(PDFFunction.parse(xref, obj));
|
||||
}
|
||||
fn = function radialAxialColorFunction(arg) {
|
||||
var out = [];
|
||||
for (var i = 0, ii = fnArray.length; i < ii; i++) {
|
||||
out.push(fnArray[i](arg)[0]);
|
||||
}
|
||||
return out;
|
||||
};
|
||||
} else {
|
||||
if (!isPDFFunction(fnObj)) {
|
||||
error('Invalid function');
|
||||
}
|
||||
fn = PDFFunction.parse(xref, fnObj);
|
||||
}
|
||||
|
||||
// 10 samples seems good enough for now, but probably won't work
|
||||
// if there are sharp color changes. Ideally, we would implement
|
||||
|
1
test/pdfs/issue2006.pdf.link
Normal file
1
test/pdfs/issue2006.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
http://pages.sencha.com/rs/sencha/images/Sencha-WP-Dev-Mgrs-Guide-to-HTML5.pdf
|
@ -713,6 +713,14 @@
|
||||
"link": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue2006",
|
||||
"file": "pdfs/issue2006.pdf",
|
||||
"md5": "71ec73831ece9b508ad20efa6ff28642",
|
||||
"rounds": 1,
|
||||
"pageLimit": 1,
|
||||
"link": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue1729",
|
||||
"file": "pdfs/issue1729.pdf",
|
||||
"md5": "29b0eddc3e1dcb23a44384037032d470",
|
||||
|
Loading…
Reference in New Issue
Block a user