From 952fde9d57b2e1d185fd5f4da5ed2e02a957e795 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sun, 26 May 2024 19:24:26 -0700 Subject: [PATCH] Use document.createElement to eliminate type assertion --- src/jcanvas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jcanvas.ts b/src/jcanvas.ts index 0858017..0b13819 100644 --- a/src/jcanvas.ts +++ b/src/jcanvas.ts @@ -4277,7 +4277,7 @@ $.fn.createPattern = function createPattern(args) { if (isFunction(source)) { // Draw pattern using function if given - img = $("")[0] as HTMLCanvasElement; + img = document.createElement("canvas"); img.width = params.width || 0; img.height = params.height || 0; const imgCtx = _getContext(img);