Compare commits
2 Commits
0f31f2556c
...
263e8ba535
Author | SHA1 | Date | |
---|---|---|---|
263e8ba535 | |||
11071a5972 |
@ -81,10 +81,19 @@
|
|||||||
store.renderer.ctx = store.renderer.canvas.getContext("2d", {
|
store.renderer.ctx = store.renderer.canvas.getContext("2d", {
|
||||||
willReadFrequently: true,
|
willReadFrequently: true,
|
||||||
});
|
});
|
||||||
store.renderer.workCanvas = new OffscreenCanvas(
|
if (typeof OffscreenCanvas != "undefined") {
|
||||||
canvas.parentElement.clientWidth,
|
store.renderer.workCanvas = new OffscreenCanvas(
|
||||||
canvas.parentElement.clientHeight
|
canvas.parentElement.clientWidth,
|
||||||
);
|
canvas.parentElement.clientHeight
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/OffscreenCanvas#Browser_compatibility
|
||||||
|
// Fallback for when offscreenCanvas is unsupported or disabled (Firefox < 44, default for Firefox?)
|
||||||
|
else {
|
||||||
|
store.renderer.workCanvas = document.createElement("canvas");
|
||||||
|
store.renderer.workCanvas.width = canvas.parentElement.clientWidth;
|
||||||
|
store.renderer.workCanvas.height = canvas.parentElement.clientHeight;
|
||||||
|
}
|
||||||
store.renderer.workCtx = store.renderer.workCanvas.getContext("2d", {
|
store.renderer.workCtx = store.renderer.workCanvas.getContext("2d", {
|
||||||
willReadFrequently: true,
|
willReadFrequently: true,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user