-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fixes #5160 #5682
Fixes #5160 #5682
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page! |
@limzykenneth I would like to have a review on this pr, thank you👍 |
added a test for the validation of parameters in anglemode and now i dont have any failed tests |
src/math/trigonometry.js
Outdated
* @method angleMode | ||
* @param {Constant} mode either RADIANS or DEGREES | ||
* | ||
* @chainable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this function made chainable? For most p5.js API there isn't much sense for functions to be chainable as they usually are not exposed as object instance methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't know the use of chaining in this type of functions i just used other mode functions as a reference:
p5.js/src/core/shape/attributes.js
Lines 139 to 141 in e32b453
* @method rectMode | |
* @param {Constant} mode either CORNER, CORNERS, CENTER, or RADIUS | |
* @chainable |
p5.js/src/core/shape/attributes.js
Lines 36 to 38 in e32b453
* @method ellipseMode | |
* @param {Constant} mode either CENTER, RADIUS, CORNER, or CORNERS | |
* @chainable |
Lines 241 to 246 in e32b453
* @method colorMode | |
* @param {Constant} mode either RGB, HSB or HSL, corresponding to | |
* Red/Green/Blue and Hue/Saturation/Brightness | |
* (or Lightness) | |
* @param {Number} [max] range for all values | |
* @chainable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can @chainable
be removed here? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's done
I'm not sure how this PR addresses #5160 which has more do to with |
In #5160 it was mentioned that adding return type to angleMode would be a solution
if this doesn't solve that issue i think it's still useful having that return and the parameter validation was just missing. |
Thanks @KevinGrajeda. Hey @limzykenneth, what do you think of the current status of this PR? Thank you! |
Looks good. Thanks! |
Thanks @KevinGrajeda and @limzykenneth ✨ |
@all-contributors please add @KevinGrajeda for code |
I've put up a pull request to add @KevinGrajeda! 🎉 |
Changes:
Screenshots of the change:
PR Checklist
npm run lint
passes