Merge pull request #19737 from Snuffleupagus/TilingPattern-color-param

Simplify handling of the color-parameter in `TilingPattern` (PR 4824 follow-up)
This commit is contained in:
Tim van der Meij 2025-03-30 11:49:11 +02:00 committed by GitHub
commit 9d237b9f96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

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

View File

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