Skip to content

Commit 08bcea9

Browse files
committed
fixed vertex property to take single digits
1 parent 3a74317 commit 08bcea9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/shape/custom_shapes.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,14 @@ class Shape {
810810
vertexProperty(name, data) {
811811
this.userVertexProperties = this.userVertexProperties || {};
812812
const key = this.vertexPropertyKey(name);
813+
814+
const dataArray = Array.isArray(data) ? data : [data];
815+
813816
if (!this.userVertexProperties[key]) {
814-
this.userVertexProperties[key] = data.length ? data.length : 1;
817+
this.userVertexProperties[key] = dataArray.length;
815818
}
816-
this.#vertexProperties[key] = data;
817-
}
819+
this.#vertexProperties[key] = dataArray;
820+
}
818821
vertexPropertyName(key) {
819822
return key.replace(/Src$/, '');
820823
}

0 commit comments

Comments
 (0)