1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #13361 from brendandahl/patterns-fixes

Fix several issues with radial/axial shadings and tiling patterns.
This commit is contained in:
Tim van der Meij 2021-05-12 20:27:37 +02:00 committed by GitHub
commit ba99e54c66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 492 additions and 50 deletions

View file

@ -245,18 +245,17 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
unreachable(`getPattern type unknown: ${shadingType}`);
}
const matrix = this.matrix;
if (matrix) {
p0 = Util.applyTransform(p0, matrix);
p1 = Util.applyTransform(p1, matrix);
if (shadingType === ShadingType.RADIAL) {
const scale = Util.singularValueDecompose2dScale(matrix);
r0 *= scale[0];
r1 *= scale[1];
}
}
return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1];
return [
"RadialAxial",
type,
this.bbox,
this.colorStops,
p0,
p1,
r0,
r1,
this.matrix,
];
},
};