@lightningjs/renderer
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -45,3 +45,10 @@ /* | ||
} | ||
const context = this.canvas.getContext('2d'); | ||
let context = this.canvas.getContext('2d'); | ||
if (!context) { | ||
// A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context | ||
// Here we try getting the context again after falling back to an HTMLCanvasElement. | ||
// See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486 | ||
this.canvas = document.createElement('canvas'); | ||
context = this.canvas.getContext('2d'); | ||
} | ||
assertTruthy(context); | ||
@@ -48,0 +55,0 @@ this.context = context; |
{ | ||
"name": "@lightningjs/renderer", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Lightning 3 Renderer", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -100,3 +100,10 @@ /* | ||
} | ||
const context = this.canvas.getContext('2d'); | ||
let context = this.canvas.getContext('2d'); | ||
if (!context) { | ||
// A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context | ||
// Here we try getting the context again after falling back to an HTMLCanvasElement. | ||
// See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486 | ||
this.canvas = document.createElement('canvas'); | ||
context = this.canvas.getContext('2d'); | ||
} | ||
assertTruthy(context); | ||
@@ -103,0 +110,0 @@ this.context = context; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2120798
48325