mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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:
commit
8a8a67de3b
2 changed files with 469 additions and 484 deletions
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue