Merge pull request #13380 from Snuffleupagus/pattern_helper-class

Re-factor and convert the code in `src/display/pattern_helper.js` to use standard classes
This commit is contained in:
Tim van der Meij 2021-05-16 13:11:04 +02:00 committed by GitHub
commit 8a8a67de3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 469 additions and 484 deletions

View File

@ -27,7 +27,7 @@ import {
Util,
warn,
} from "../shared/util.js";
import { getShadingPatternFromIR, TilingPattern } from "./pattern_helper.js";
import { getShadingPattern, TilingPattern } from "./pattern_helper.js";
// <canvas> contexts store most of the state we need natively.
// However, PDF needs a bit more state, which we store here.
@ -1973,7 +1973,7 @@ const CanvasGraphics = (function CanvasGraphicsClosure() {
baseTransform
);
} else {
pattern = getShadingPatternFromIR(IR);
pattern = getShadingPattern(IR);
}
return pattern;
}
@ -2007,7 +2007,7 @@ const CanvasGraphics = (function CanvasGraphicsClosure() {
const ctx = this.ctx;
this.save();
const pattern = getShadingPatternFromIR(patternIR);
const pattern = getShadingPattern(patternIR);
ctx.fillStyle = pattern.getPattern(ctx, this, true);
const inv = ctx.mozCurrentTransformInverse;

File diff suppressed because it is too large Load Diff