@thi.ng/hiccup-canvas 2.5.13 → 2.5.14

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-02-10T08:59:56Z
3
+ - **Last updated**: 2024-02-19T15:50:26Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [2.5.14](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-canvas@2.5.14) (2024-02-19)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - fix [#448](https://github.com/thi-ng/umbrella/issues/448), pass vertex layout opts to packedPolyline()/packedPolygon() ([eb2bdc0](https://github.com/thi-ng/umbrella/commit/eb2bdc0))
17
+ - update args for packedPolyline()/packedPolygon()
18
+ - update draw() delegation call sites
19
+
12
20
  ### [2.5.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-canvas@2.5.2) (2023-12-19)
13
21
 
14
22
  #### 🩹 Bug fixes
package/README.md CHANGED
@@ -394,12 +394,12 @@ the number of indices between each vector x/y component and/or each point
394
394
  respectively) can be given as attributes and thus these packaged shapes support
395
395
  both AOS and SOA memory layouts/arrangements.
396
396
 
397
- Defaults:
397
+ Options & defaults:
398
398
 
399
- - start index: 0
400
- - number of vertices: (array_length - start) / estride
401
- - component stride: 1
402
- - element stride: 2
399
+ - `start`: start index = 0
400
+ - `num`: number of vertices = `(array_length - start) / estride`
401
+ - `cstride`: component stride = 1
402
+ - `estride`: element stride = 2
403
403
 
404
404
  ```ts
405
405
  ["packedPoints", { cstride: 1, estride: 4 },
package/draw.js CHANGED
@@ -75,13 +75,13 @@ const draw = (ctx, shape, pstate = { attribs: {}, edits: [] }) => {
75
75
  polyline(ctx, attribs, shape[2]);
76
76
  break;
77
77
  case "packedPolyline":
78
- packedPolyline(ctx, attribs, shape[2]);
78
+ packedPolyline(ctx, attribs, origAttribs, shape[2]);
79
79
  break;
80
80
  case "polygon":
81
81
  polygon(ctx, attribs, shape[2]);
82
82
  break;
83
83
  case "packedPolygon":
84
- packedPolygon(ctx, attribs, shape[2]);
84
+ packedPolygon(ctx, attribs, origAttribs, shape[2]);
85
85
  break;
86
86
  case "path":
87
87
  path(ctx, attribs, shape[2]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup-canvas",
3
- "version": "2.5.13",
3
+ "version": "2.5.14",
4
4
  "description": "Hiccup shape tree renderer for vanilla Canvas 2D contexts",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -37,10 +37,10 @@
37
37
  "dependencies": {
38
38
  "@thi.ng/api": "^8.9.23",
39
39
  "@thi.ng/checks": "^3.4.23",
40
- "@thi.ng/color": "^5.6.19",
40
+ "@thi.ng/color": "^5.6.20",
41
41
  "@thi.ng/math": "^5.10.0",
42
- "@thi.ng/pixel": "^6.1.7",
43
- "@thi.ng/vectors": "^7.10.7"
42
+ "@thi.ng/pixel": "^6.1.8",
43
+ "@thi.ng/vectors": "^7.10.8"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.40.1",
@@ -130,5 +130,5 @@
130
130
  ],
131
131
  "year": 2018
132
132
  },
133
- "gitHead": "25ee18f7db6d03f0b76787267ab071d16df94888\n"
133
+ "gitHead": "ea2ec2e4f14c572bbfac00c43953a6c4033da09e\n"
134
134
  }
package/polygon.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { IObjectOf } from "@thi.ng/api";
2
2
  import type { ReadonlyVec } from "@thi.ng/vectors";
3
3
  export declare const polygon: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, pts: ReadonlyVec[]) => void;
4
- export declare const packedPolygon: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, pts: ArrayLike<number>) => void;
4
+ export declare const packedPolygon: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, opts: IObjectOf<any>, pts: ArrayLike<number>) => void;
5
5
  /**
6
6
  * Shared internal helper for polygon & polyline fns.
7
7
  *
@@ -15,7 +15,7 @@ export declare const __drawPoly: (ctx: CanvasRenderingContext2D, pts: ReadonlyVe
15
15
  * Shared internal helper for packed polygon & polyline fns.
16
16
  *
17
17
  * @param ctx - canvas context
18
- * @param ctx - shape attribs (incl. packing config)
18
+ * @param opts - original shape atttribs (here only for packing config)
19
19
  * @param pts - flat vertex buffer
20
20
  *
21
21
  * @internal
package/polygon.js CHANGED
@@ -6,10 +6,10 @@ const polygon = (ctx, attribs, pts) => {
6
6
  ctx.closePath();
7
7
  __endShape(ctx, attribs);
8
8
  };
9
- const packedPolygon = (ctx, attribs, pts) => {
9
+ const packedPolygon = (ctx, attribs, opts, pts) => {
10
10
  if (pts.length < 2)
11
11
  return;
12
- __drawPackedPoly(ctx, attribs, pts);
12
+ __drawPackedPoly(ctx, opts, pts);
13
13
  ctx.closePath();
14
14
  __endShape(ctx, attribs);
15
15
  };
package/polyline.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { IObjectOf } from "@thi.ng/api";
2
2
  import type { ReadonlyVec } from "@thi.ng/vectors";
3
3
  export declare const polyline: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, pts: ReadonlyVec[]) => void;
4
- export declare const packedPolyline: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, pts: ArrayLike<number>) => void;
4
+ export declare const packedPolyline: (ctx: CanvasRenderingContext2D, attribs: IObjectOf<any>, opts: IObjectOf<any>, pts: ArrayLike<number>) => void;
5
5
  //# sourceMappingURL=polyline.d.ts.map
package/polyline.js CHANGED
@@ -6,10 +6,10 @@ const polyline = (ctx, attribs, pts) => {
6
6
  __drawPoly(ctx, pts);
7
7
  __endShape(ctx, attribs, false);
8
8
  };
9
- const packedPolyline = (ctx, attribs, pts) => {
9
+ const packedPolyline = (ctx, attribs, opts, pts) => {
10
10
  if (pts.length < 2)
11
11
  return;
12
- __drawPackedPoly(ctx, attribs, pts);
12
+ __drawPackedPoly(ctx, opts, pts);
13
13
  __endShape(ctx, attribs, false);
14
14
  };
15
15
  export {
@@ -1 +0,0 @@
1
- {"version":3,"file":"end-shape.d.ts","sourceRoot":"","sources":["../src/internal/end-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,gBAAgB;AAChB,eAAO,MAAM,UAAU,QACjB,wBAAwB,WACpB,UAAU,GAAG,CAAC,2BAavB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/internal/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA0D3C,gBAAgB;AAChB,eAAO,MAAM,YAAY,QACnB,wBAAwB,SACtB,SAAS,WACP,UAAU,GAAG,CAAC,0BA+BvB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,cAAc,QACrB,wBAAwB,QACvB,SAAS,QACT,SAAS,SAaf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,UACvB,SAAS,MACZ,MAAM,KACP,cAAc,SAIjB,CAAC"}