laymur 0.13.7 → 0.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/miscellaneous/canvas.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6576,14 +6576,34 @@ class UIAnimatedImage extends UIElement {
|
|
|
6576
6576
|
* @returns Canvas instance
|
|
6577
6577
|
*/
|
|
6578
6578
|
function createCanvas(width, height) {
|
|
6579
|
-
if (typeof OffscreenCanvas !== "undefined") {
|
|
6580
|
-
return new OffscreenCanvas(width, height);
|
|
6581
|
-
}
|
|
6582
6579
|
const canvas = document.createElement("canvas");
|
|
6583
6580
|
canvas.width = width;
|
|
6584
6581
|
canvas.height = height;
|
|
6585
6582
|
return canvas;
|
|
6586
6583
|
}
|
|
6584
|
+
// /** Canvas type that works both in main thread and workers */
|
|
6585
|
+
// export type UICanvas = OffscreenCanvas | HTMLCanvasElement;
|
|
6586
|
+
// /** 2D rendering context type for UICanvas */
|
|
6587
|
+
// export type UICanvasRenderingContext2D =
|
|
6588
|
+
// | OffscreenCanvasRenderingContext2D
|
|
6589
|
+
// | CanvasRenderingContext2D;
|
|
6590
|
+
// /**
|
|
6591
|
+
// * Creates a canvas with OffscreenCanvas fallback to HTMLCanvasElement.
|
|
6592
|
+
// * Uses OffscreenCanvas when available, falls back to HTMLCanvasElement otherwise.
|
|
6593
|
+
// *
|
|
6594
|
+
// * @param width - Canvas width in pixels
|
|
6595
|
+
// * @param height - Canvas height in pixels
|
|
6596
|
+
// * @returns Canvas instance
|
|
6597
|
+
// */
|
|
6598
|
+
// export function createCanvas(width: number, height: number): UICanvas {
|
|
6599
|
+
// if (typeof OffscreenCanvas !== "undefined") {
|
|
6600
|
+
// return new OffscreenCanvas(width, height);
|
|
6601
|
+
// }
|
|
6602
|
+
// const canvas = document.createElement("canvas");
|
|
6603
|
+
// canvas.width = width;
|
|
6604
|
+
// canvas.height = height;
|
|
6605
|
+
// return canvas;
|
|
6606
|
+
// }
|
|
6587
6607
|
|
|
6588
6608
|
const GRAPHICS_DEFAULT_WIDTH = 2;
|
|
6589
6609
|
const GRAPHICS_DEFAULT_HEIGHT = 2;
|