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.

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your work on this. The issue is actually assigned to someone else and already had an opened PR for it, so I need to close your PR. Thanks for your work on this.

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

2 participants