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
@ -27,7 +27,7 @@ import {
|
|||||||
Util,
|
Util,
|
||||||
warn,
|
warn,
|
||||||
} from "../shared/util.js";
|
} 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.
|
// <canvas> contexts store most of the state we need natively.
|
||||||
// However, PDF needs a bit more state, which we store here.
|
// However, PDF needs a bit more state, which we store here.
|
||||||
@ -1973,7 +1973,7 @@ const CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
baseTransform
|
baseTransform
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
pattern = getShadingPatternFromIR(IR);
|
pattern = getShadingPattern(IR);
|
||||||
}
|
}
|
||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
@ -2007,7 +2007,7 @@ const CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
const ctx = this.ctx;
|
const ctx = this.ctx;
|
||||||
|
|
||||||
this.save();
|
this.save();
|
||||||
const pattern = getShadingPatternFromIR(patternIR);
|
const pattern = getShadingPattern(patternIR);
|
||||||
ctx.fillStyle = pattern.getPattern(ctx, this, true);
|
ctx.fillStyle = pattern.getPattern(ctx, this, true);
|
||||||
|
|
||||||
const inv = ctx.mozCurrentTransformInverse;
|
const inv = ctx.mozCurrentTransformInverse;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user