tela.js 1.1.1 → 1.1.2

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/README.md CHANGED
@@ -21,12 +21,9 @@ Playground usage:
21
21
  ```html
22
22
  <!DOCTYPE html>
23
23
  <html lang="en">
24
-
25
24
  <head>
26
25
  </head>
27
-
28
26
  <body>
29
-
30
27
  </body>
31
28
  <script type="module">
32
29
  import { Canvas, Color, loop } from "https://cdn.jsdelivr.net/npm/tela.js/src/index.js";
@@ -49,7 +46,6 @@ Playground usage:
49
46
  document.body.appendChild(canvas.DOM);
50
47
 
51
48
  </script>
52
-
53
49
  </html>
54
50
  ```
55
51
 
@@ -57,8 +53,7 @@ Playground usage:
57
53
  Install `tela.js` it using `npm install tela.js` / `bun add tela.js`.
58
54
 
59
55
  ```js
60
- import { loop, Color } from "tela.js/src/index.node.js";
61
- import Window from "tela.js/src/Tela/Window.js";
56
+ import { loop, Color, Window} from "tela.js/src/index.node.js";
62
57
 
63
58
  const width = 640;
64
59
  const height = 480;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tela.js",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "author": "Pedroth",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,7 +40,10 @@ let prevSceneHash = undefined;
40
40
 
41
41
  export function parallelWorkers(camera, scene, canvas, params = {}) {
42
42
  // lazy loading workers
43
- if (WORKERS.length === 0) WORKERS = [...Array(NUMBER_OF_CORES)].map(() => new MyWorker(`/src/Camera/rayTraceWorker.js`));
43
+ if (WORKERS.length === 0) {
44
+ WORKERS = [...Array(NUMBER_OF_CORES)]
45
+ .map(() => new MyWorker(`${IS_NODE ? "." : ""}/src/Camera/rayTraceWorker.js`));
46
+ }
44
47
  const w = canvas.width;
45
48
  const h = canvas.height;
46
49
  const isNewScene = prevSceneHash !== scene.hash;
package/src/index.node.js CHANGED
@@ -2,8 +2,7 @@ export * from "./index.js";
2
2
  import * as IO from "./IO/IO.js"
3
3
  import Parallel from "./IO/Parallel.js";
4
4
  import Image from "./Tela/Image.js"
5
- // import Window from "./Window/Window.js"
5
+ import Window from "./Tela/Window.js"
6
6
 
7
- // export { IO, Image, Window };
8
- export { IO, Image, Parallel };
7
+ export { IO, Image, Parallel, Window };
9
8
  export * from "./Utils/Video.js"