mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-24 16:07:22 +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);
|
const fn = pdfFunctionFactory.create(fnObj, /* parseArray = */ true);
|
||||||
|
|
||||||
// Domain [x0, x1, y0, y1]; defaults to [0, 1, 0, 1].
|
// Domain [x0, x1, y0, y1]; defaults to [0, 1, 0, 1].
|
||||||
let x0 = 0,
|
const [x0, x1, y0, y1] = lookupRect(dict.getArray("Domain"), [0, 1, 0, 1]);
|
||||||
x1 = 1,
|
|
||||||
y0 = 0,
|
|
||||||
y1 = 1;
|
|
||||||
const domainArr = lookupRect(dict.getArray("Domain"), null);
|
|
||||||
if (domainArr) {
|
|
||||||
[x0, x1, y0, y1] = domainArr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Matrix maps shading (domain) space to user space; defaults to identity.
|
// Matrix maps shading (domain) space to user space; defaults to identity.
|
||||||
const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
|
const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user