1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Simplify handling of the color-parameter in TilingPattern (PR 4824 follow-up)

The color-parameter is already available through `IR` (i.e. the internal representation), and after the changes in PR 4824 (which landed in 2014) we no longer need any special handling for it.
This commit is contained in:
Jonas Jenwald 2025-03-29 13:02:13 +01:00
parent dfa553dc11
commit 09118670ca
2 changed files with 2 additions and 4 deletions

View file

@ -2301,7 +2301,6 @@ class CanvasGraphics {
getColorN_Pattern(IR) {
let pattern;
if (IR[0] === "TilingPattern") {
const color = IR[1];
const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);
const canvasGraphicsFactory = {
createCanvasGraphics: ctx =>
@ -2319,7 +2318,6 @@ class CanvasGraphics {
};
pattern = new TilingPattern(
IR,
color,
this.ctx,
canvasGraphicsFactory,
baseTransform

View file

@ -462,7 +462,8 @@ class TilingPattern {
// 10in @ 300dpi shall be enough.
static MAX_PATTERN_SIZE = 3000;
constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {
constructor(IR, ctx, canvasGraphicsFactory, baseTransform) {
this.color = IR[1];
this.operatorList = IR[2];
this.matrix = IR[3];
this.bbox = IR[4];
@ -470,7 +471,6 @@ class TilingPattern {
this.ystep = IR[6];
this.paintType = IR[7];
this.tilingType = IR[8];
this.color = color;
this.ctx = ctx;
this.canvasGraphicsFactory = canvasGraphicsFactory;
this.baseTransform = baseTransform;