Remove unused properties from the Shadings
-implementations in src/core/pattern.js
Neither the `type` or the `cs` properties are used outside of the "constructors", and we can thus remove them.[1] Note that a lot of this code is very old, and that it actually predates the main/worker-thread split before which the *same* file was used on both the main- *and* worker-threads. --- [1] On the main-thread, a similar `type` property was removed in PR 12591.
This commit is contained in:
parent
e394da5861
commit
612b43852b
@ -125,7 +125,6 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||||||
this.matrix = matrix;
|
this.matrix = matrix;
|
||||||
this.coordsArr = dict.getArray("Coords");
|
this.coordsArr = dict.getArray("Coords");
|
||||||
this.shadingType = dict.get("ShadingType");
|
this.shadingType = dict.get("ShadingType");
|
||||||
this.type = "Pattern";
|
|
||||||
const cs = ColorSpace.parse({
|
const cs = ColorSpace.parse({
|
||||||
cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"),
|
cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"),
|
||||||
xref,
|
xref,
|
||||||
@ -133,7 +132,6 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||||||
pdfFunctionFactory,
|
pdfFunctionFactory,
|
||||||
localColorSpaceCache,
|
localColorSpaceCache,
|
||||||
});
|
});
|
||||||
this.cs = cs;
|
|
||||||
const bbox = dict.getArray("BBox");
|
const bbox = dict.getArray("BBox");
|
||||||
if (Array.isArray(bbox) && bbox.length === 4) {
|
if (Array.isArray(bbox) && bbox.length === 4) {
|
||||||
this.bbox = Util.normalizeRect(bbox);
|
this.bbox = Util.normalizeRect(bbox);
|
||||||
@ -851,7 +849,6 @@ Shadings.Mesh = (function MeshClosure() {
|
|||||||
const dict = stream.dict;
|
const dict = stream.dict;
|
||||||
this.matrix = matrix;
|
this.matrix = matrix;
|
||||||
this.shadingType = dict.get("ShadingType");
|
this.shadingType = dict.get("ShadingType");
|
||||||
this.type = "Pattern";
|
|
||||||
const bbox = dict.getArray("BBox");
|
const bbox = dict.getArray("BBox");
|
||||||
if (Array.isArray(bbox) && bbox.length === 4) {
|
if (Array.isArray(bbox) && bbox.length === 4) {
|
||||||
this.bbox = Util.normalizeRect(bbox);
|
this.bbox = Util.normalizeRect(bbox);
|
||||||
@ -865,7 +862,6 @@ Shadings.Mesh = (function MeshClosure() {
|
|||||||
pdfFunctionFactory,
|
pdfFunctionFactory,
|
||||||
localColorSpaceCache,
|
localColorSpaceCache,
|
||||||
});
|
});
|
||||||
this.cs = cs;
|
|
||||||
this.background = dict.has("Background")
|
this.background = dict.has("Background")
|
||||||
? cs.getRgb(dict.get("Background"), 0)
|
? cs.getRgb(dict.get("Background"), 0)
|
||||||
: null;
|
: null;
|
||||||
@ -946,9 +942,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
Shadings.Dummy = (function DummyClosure() {
|
Shadings.Dummy = (function DummyClosure() {
|
||||||
function Dummy() {
|
function Dummy() {}
|
||||||
this.type = "Pattern";
|
|
||||||
}
|
|
||||||
|
|
||||||
Dummy.prototype = {
|
Dummy.prototype = {
|
||||||
getIR: function Dummy_getIR() {
|
getIR: function Dummy_getIR() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user