Merge pull request #12626 from mike-000/patch-9
Set canvas style to override problem 3rd party css
This commit is contained in:
+10
-6
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user