Work around TypeScript being too smart.

This commit is contained in:
Juliusz Chroboczek
2025-03-23 12:43:47 +01:00
parent 4f215f8e3c
commit 9617c68fd6
+5
View File
@@ -1405,11 +1405,16 @@ let filters = {
ctx.filter = 'none';
} else {
// Safari bug 198416, context.filter is not supported.
// Work around typescript inferring ctx as none
ctx = /**@type{CanvasRenderingContext2D}*/(ctx);
let scale = 24;
let swidth = src.videoWidth / scale;
let sheight = src.videoHeight / scale;
if(!('canvas' in this.userdata))
this.userdata.canvas = document.createElement('canvas');
/** @type {HTMLCanvasElement} */
let c2 = this.userdata.canvas;
if(c2.width != swidth)
c2.width = swidth;