Skip to content

Commit 80f3212

Browse files
committed
Add automatic id to geometry to fix examples
1 parent 3d2f4c7 commit 80f3212

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/webgl/p5.Geometry.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class Geometry {
6262
this._hasFillTransparency = undefined;
6363
this._hasStrokeTransparency = undefined;
6464

65+
this.gid = `_p5_Geometry_${Geometry.nextId}`;
66+
Geometry.nextId++;
6567
if (callback instanceof Function) {
6668
callback.call(this);
6769
}
@@ -1917,6 +1919,12 @@ class Geometry {
19171919
}
19181920
};
19191921

1922+
/**
1923+
* Keeps track of how many custom geometry objects have been made so that each
1924+
* can be assigned a unique ID.
1925+
*/
1926+
Geometry.nextId = 0;
1927+
19201928
function geometry(p5, fn){
19211929
/**
19221930
* A class to describe a 3D shape.

0 commit comments

Comments
 (0)