Skip to content

Commit

Permalink
fix: prevent empty colors array in get method
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Feb 13, 2024
1 parent 469d21a commit 040aa8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bim-fragment",
"version": "1.3.10",
"version": "1.3.11",
"description": "3D BIM Geometry API",
"main": "src/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions resources/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4230,6 +4230,7 @@ let Fragment$1 = class Fragment {
if (this.mesh.instanceColor) {
const color = new THREE.Color();
this.mesh.getColorAt(id, color);
colorsArray.push(color);
}
}
const colors = colorsArray.length ? colorsArray : undefined;
Expand Down
1 change: 1 addition & 0 deletions src/fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class Fragment {
if (this.mesh.instanceColor) {
const color = new THREE.Color();
this.mesh.getColorAt(id, color);
colorsArray.push(color);
}
}
const colors = colorsArray.length ? colorsArray : undefined;
Expand Down

0 comments on commit 040aa8a

Please sign in to comment.