-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
Description
Hi! I'm trying to use tiny-sdf in a web-worker, and document.createElement("canvas") isn't working because document isn't found on the global object.
I'm happy to make a PR that does something like
if (self.OffscreenCanvas) {
this.canvas = new OffscreenCanvas(size, size);
} else {
this.canvas = document.createElement("canvas");
this.canvas.width = this.canvas.height = size;
}or that reversed, or using some different kind of logical test. Looks like your eslint config doesn't love OffscreenCanvas, so I might need some help convincing it too.
Not super urgent, I think I can hack around this until it's fixed here.
Swoorup