Merge pull request #12626 from mike-000/patch-9

Set canvas style to override problem 3rd party css
This commit is contained in:
Andreas Hocevar
2021-08-16 12:15:07 +02:00
committed by GitHub
+10 -6
View File
@@ -19,12 +19,16 @@ export function createCanvasContext2D(
opt_canvasPool, opt_canvasPool,
opt_Context2DSettings opt_Context2DSettings
) { ) {
const canvas = /** @type {HTMLCanvasElement|OffscreenCanvas} */
opt_canvasPool && opt_canvasPool.length let canvas;
? opt_canvasPool.shift() if (opt_canvasPool && opt_canvasPool.length) {
: WORKER_OFFSCREEN_CANVAS canvas = opt_canvasPool.shift();
? new OffscreenCanvas(opt_width || 300, opt_height || 300) } else if (WORKER_OFFSCREEN_CANVAS) {
: document.createElement('canvas'); canvas = new OffscreenCanvas(opt_width || 300, opt_height || 300);
} else {
canvas = document.createElement('canvas');
canvas.style.all = 'initial';
}
if (opt_width) { if (opt_width) {
canvas.width = opt_width; canvas.width = opt_width;
} }