Skip to content

fix: [2.x] Fix dimensional quirk in the setHeading() method of #8677

Open
localhost-legend wants to merge 1 commit intoprocessing:mainfrom
localhost-legend:fix/issue-8215-mn6660sh
Open

fix: [2.x] Fix dimensional quirk in the setHeading() method of #8677
localhost-legend wants to merge 1 commit intoprocessing:mainfrom
localhost-legend:fix/issue-8215-mn6660sh

Conversation

@localhost-legend
Copy link

Summary

  - **src/math/p5.Vector.js**: Added input validation for the heading parameter and maintained existing functionality

  What changed
  Modify the `setHeading()` method to support only 2D vectors and add error messages for vectors of other dimensions.

   Testing
  I tested this locally and the changes work as expected. Happy to make any adjustments if needed!

  Closes #8215

@welcome
Copy link

welcome bot commented Mar 25, 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!

@localhost-legend
Copy link
Author

Thank you for the warm welcome and for providing the contributor guidelines and resources. I'll make sure to link this PR to an approved issue going forward, and I'll review the discussion to ensure I'm not duplicating effort. I'll also add myself to the list of contributors once this PR is merged, thanks for the reminder.

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.

1 participant