@weasel-js/renderer 1.9.4 → 1.10.0

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
@@ -32,7 +32,7 @@ that can share a draw call are merged into one.
32
32
 
33
33
  ## Paint
34
34
 
35
- - `commandFill` and `commandStroke` resolve a `FillStyle` or `Stroke` against a
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-ORBXHIRB.js';
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-2VOBNWBN.js.map
11
- //# sourceMappingURL=chunk-2VOBNWBN.js.map
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"]}