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);