We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d2f7a1c + f8f4218 commit 8c7be34Copy full SHA for 8c7be34
src/index.ts
@@ -33,6 +33,9 @@ dom.window.HTMLCanvasElement.prototype.getContext = function () {
33
if (arguments[0] === 'webgl') {
34
// create headless-gl GL context
35
const ctx: ReturnType<typeof createContext> & Partial<StackGlResize> = createContext(1, 1, arguments[1])
36
+ if (!ctx) {
37
+ return ctx
38
+ }
39
// insert the resize method to the context so that lcjs package can use it
40
ctx.resize = ctx.getExtension('STACKGL_resize_drawingbuffer').resize
41
return ctx
0 commit comments