Skip to content

Commit 3d7bd8c

Browse files
fix(geom): fix path __samples attrib handling in asPolygon() & asPolyline() impls
1 parent 5d594c6 commit 3d7bd8c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/geom/src/as-polygon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const asPolygon = <AsPolygonFn>(
8888
),
8989

9090
path: ($: Path, opts) => {
91-
const tmp = new Path();
91+
const tmp = new Path([], [], $.attribs);
9292
return [$.segments, ...$.subPaths].map((segments) => {
9393
tmp.segments = segments;
9494
return new Polygon(vertices(tmp, opts), __attribs($));

packages/geom/src/as-polyline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const asPolyline = <AsPolylineFn>(
106106
],
107107

108108
path: ($: Path, opts) => {
109-
const tmp = new Path();
109+
const tmp = new Path([], [], $.attribs);
110110
return [$.segments, ...$.subPaths].map((segments) => {
111111
tmp.segments = segments;
112112
const pts = vertices(tmp, opts);

0 commit comments

Comments
 (0)