@weasel-js/renderer 1.9.4 → 1.10.1
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 +2 -2
- package/dist/{chunk-2VOBNWBN.js → chunk-43YL7HZV.js} +3 -3
- package/dist/chunk-43YL7HZV.js.map +1 -0
- package/dist/{chunk-VHQJ56XQ.js → chunk-K7XCWVQH.js} +236 -168
- package/dist/chunk-K7XCWVQH.js.map +1 -0
- package/dist/{chunk-ORBXHIRB.js → chunk-Q4SIHV7Q.js} +4 -4
- package/dist/chunk-Q4SIHV7Q.js.map +1 -0
- package/dist/{imageCache-oJVgxhkr.d.ts → imageCache-DucOxC7l.d.ts} +73 -115
- package/dist/index.d.ts +201 -204
- package/dist/index.js +577 -291
- package/dist/index.js.map +1 -1
- package/dist/mesh.d.ts +34 -67
- package/dist/mesh.js +5 -5
- package/dist/mesh.js.map +1 -1
- package/dist/{paintKinds-B2vEy9A4.d.ts → paintKinds-BmPAT51k.d.ts} +22 -38
- package/dist/patterns-builtin.d.ts +10 -16
- package/dist/patterns-builtin.js +7 -7
- package/dist/patterns-builtin.js.map +1 -1
- package/dist/test-seams.d.ts +22 -65
- package/dist/test-seams.js +2 -2
- package/dist/testing/glRecorder.d.ts +2 -5
- package/dist/testing/glRecorder.js +3 -0
- package/dist/testing/glRecorder.js.map +1 -1
- package/dist/testing/vertexUploads.d.ts +4 -6
- package/dist/testing/vertexUploads.js.map +1 -1
- package/package.json +7 -7
- package/dist/chunk-2VOBNWBN.js.map +0 -1
- package/dist/chunk-ORBXHIRB.js.map +0 -1
- package/dist/chunk-VHQJ56XQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A WebGL2 renderer that turns a list of draw commands into pixels.
|
|
|
4
4
|
|
|
5
5
|
Part of [weasel](https://github.com/orochi235/weasel), a domain-agnostic 2D
|
|
6
6
|
scene-graph canvas kit for React. See the
|
|
7
|
-
[API reference](https://orochi235.github.io/weasel/
|
|
7
|
+
[API reference](https://orochi235.github.io/weasel/#pkg/renderer).
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install @weasel-js/renderer
|
|
@@ -32,7 +32,7 @@ that can share a draw call are merged into one.
|
|
|
32
32
|
|
|
33
33
|
## Paint
|
|
34
34
|
|
|
35
|
-
- `
|
|
35
|
+
- `commandPaint` and `commandStroke` resolve a `Paint` or `Stroke` against a
|
|
36
36
|
pose box into what a command carries.
|
|
37
37
|
- `createTilePattern` builds a repeating tile; `resolvePatternSpec` builds one
|
|
38
38
|
from a serializable `TilePatternSpec`. The named tiles (`hatch`, `crosshatch`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rasterizeTile, registerTexture } from './chunk-
|
|
1
|
+
import { rasterizeTile, registerTexture } from './chunk-Q4SIHV7Q.js';
|
|
2
2
|
|
|
3
3
|
// src/patterns/index.ts
|
|
4
4
|
function createTilePattern(opts) {
|
|
@@ -7,5 +7,5 @@ function createTilePattern(opts) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { createTilePattern };
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-43YL7HZV.js.map
|
|
11
|
+
//# sourceMappingURL=chunk-43YL7HZV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/patterns/index.ts"],"names":[],"mappings":";;;AA2BO,SAAS,kBAAkB,IAAA,EAA6C;AAC7E,EAAA,MAAM,MAAA,GAAS,cAAc,IAAI,CAAA;AACjC,EAAA,OAAO,MAAA,GAAS,eAAA,CAAgB,MAAM,CAAA,GAAI,IAAA;AAC5C","file":"chunk-43YL7HZV.js","sourcesContent":["/**\n * Tile-pattern primitive — a small helper for building repeating texture\n * tiles from a draw callback. The result plugs into a `Paint` of\n * `{ kind: 'texture', texture }` (see `@weasel-js/paint`).\n *\n * For ready-to-use named patterns (hatch, crosshatch, dots, chunks),\n * see the `@weasel-js/renderer/patterns-builtin` subpath.\n */\n\nimport { registerTexture } from '../textures/registerTexture';\nimport type { TextureHandle } from '../textures/registerTexture';\nimport { rasterizeTile } from './rasterizeTile';\n\n/** Options for `createTilePattern`. */\nexport interface TilePatternOpts {\n /** Edge length (in pixels) of the square offscreen tile. */\n size: number;\n /** Paint one tile at integer-pixel coordinates `(0, 0) .. (size, size)`. */\n draw: (oc: CanvasRenderingContext2D, size: number) => void;\n}\n\n/**\n * Render a single tile and register it as a GL texture, returning a\n * `TextureHandle` you can wrap in a `Paint` of\n * `{ kind: 'texture', texture }`. Returns `null` only when an\n * `OffscreenCanvas`/2D context can't be acquired.\n */\nexport function createTilePattern(opts: TilePatternOpts): TextureHandle | null {\n const bitmap = rasterizeTile(opts);\n return bitmap ? registerTexture(bitmap) : null;\n}\n"]}
|