Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ESLint issues in GeometryBuilder.js #7529

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/webgl/GeometryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ class GeometryBuilder {
);
}
if (this.renderer._doStroke) {
input.edges.forEach(edge => {
edge.forEach(idx => {
// Ensure each edge (stroke) vertex gets the 'len' property from the corresponding fill vertex
const len = (input.vertices[idx] && input.vertices[idx].len)
? input.vertices[idx].len
: 1.0;

// Default to 1.0 if 'len' is missing
// Here, we're adding 'len' to the vertexColors array or you could add it to a separate array if needed
if (!this.geometry.vertexLengths) {
this.geometry.vertexLengths = []; // Create if it doesn't exist
}
this.geometry.vertexLengths.push(len);
});
});
this.geometry.edges.push(
...input.edges.map(edge => edge.map(idx => idx + startIdx))
);
Expand Down