Skip to content

Conversation

@aashu2006
Copy link

@aashu2006 aashu2006 commented Dec 15, 2025

Resolves #8215

Changes:

  • Restrict p5.Vector.prototype.setHeading() to vectors with a zero or undefined z component.
  • Throw an error when setHeading() is called on vectors with a non-zero z value.
  • Added unit tests to cover invalid-dimension behavior.

Screenshots of the change:
N/A (non-visual change)

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated

@aashu2006
Copy link
Author

Happy to adjust this if a different error behavior or messaging is preferred.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.x] Fix dimensional quirk in the setHeading() method of p5.Vector

1 participant