Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

fix: prevent browser freeze when tessellating >50k vertices (#8219 )#8555

Open
Nixxx19 wants to merge 1 commit intoprocessing:mainfrom
Nixxx19:nityam/tessellation-freeze-fix
Open

fix: prevent browser freeze when tessellating >50k vertices (#8219 )#8555
Nixxx19 wants to merge 1 commit intoprocessing:mainfrom
Nixxx19:nityam/tessellation-freeze-fix

Conversation

Copy link

Nixxx19 commented Feb 22, 2026

Resolves #8219

Changes:

  • Added vertex count validation in _processVertices() before calling _tesselateShape() to prevent browser freeze
  • Shows friendly warning message when vertex count exceeds 50,000 vertices
  • Skips tessellation for large shapes and falls back to TRIANGLE_FAN mode so shapes still render
  • Added unit tests to verify warning behavior and normal operation for safe vertex counts

The fix prevents the browser from freezing when libtess tries to tessellate shapes with >65k vertices. The freeze was happening inside libtess during _triangulate(), before any buffer caching logic could run.

Screenshots of the change:

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated (not applicable - this is a bug fix)
  • [Unit tests] are included / updated

Copy link

welcome bot commented Feb 22, 2026

Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

Copy link
Author

Nixxx19 commented Feb 22, 2026

cc @davepagurek @ksen0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Browser freeze when creating >65k vertices in draw() loop (no validation or warning)

1 participant