Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Avoid all rendering breaking completely when CanvasPattern.setTransform() is unsupported" (PR 13725 follow-up) #15581

Merged
merged 1 commit into from
Oct 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions src/display/pattern_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
shadow,
unreachable,
Util,
warn,
} from "../shared/util.js";
import { getCurrentTransform } from "./display_utils.js";
import { isNodeJS } from "../shared/is_node.js";
Expand Down Expand Up @@ -140,13 +139,7 @@ class RadialAxialShadingPattern extends BaseShadingPattern {

pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat");
const domMatrix = new DOMMatrix(inverse);
try {
pattern.setTransform(domMatrix);
} catch (ex) {
// Avoid rendering breaking completely in Firefox 78 ESR,
// and in Node.js (see issue 13724).
warn(`RadialAxialShadingPattern.getPattern: "${ex?.message}".`);
}
pattern.setTransform(domMatrix);
} else {
// Shading fills are applied relative to the current matrix which is also
// how canvas gradients work, so there's no need to do anything special
Expand Down Expand Up @@ -680,13 +673,8 @@ class TilingPattern {
);

const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat");
try {
pattern.setTransform(domMatrix);
} catch (ex) {
// Avoid rendering breaking completely in Firefox 78 ESR,
// and in Node.js (see issue 13724).
warn(`TilingPattern.getPattern: "${ex?.message}".`);
}
pattern.setTransform(domMatrix);

return pattern;
}
}
Expand Down