mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-18 11:14:02 +02:00
Take full advantage of the lookupRect helper in the FunctionBasedShading constructor
This commit is contained in:
parent
654985c621
commit
0fd556f435
@ -414,14 +414,7 @@ class FunctionBasedShading extends BaseShading {
|
||||
const fn = pdfFunctionFactory.create(fnObj, /* parseArray = */ true);
|
||||
|
||||
// Domain [x0, x1, y0, y1]; defaults to [0, 1, 0, 1].
|
||||
let x0 = 0,
|
||||
x1 = 1,
|
||||
y0 = 0,
|
||||
y1 = 1;
|
||||
const domainArr = lookupRect(dict.getArray("Domain"), null);
|
||||
if (domainArr) {
|
||||
[x0, x1, y0, y1] = domainArr;
|
||||
}
|
||||
const [x0, x1, y0, y1] = lookupRect(dict.getArray("Domain"), [0, 1, 0, 1]);
|
||||
|
||||
// Matrix maps shading (domain) space to user space; defaults to identity.
|
||||
const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user