Skip to content
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

Updated strokeWeight() documentation #5480

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/core/shape/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ p5.prototype.strokeJoin = function(join) {
* Sets the width of the stroke used for lines, points and the border around
* shapes. All widths are set in units of pixels.
*
* Note that it is affected by any transformation or scaling that has
* been applied previously.
*
* @method strokeWeight
* @param {Number} weight the weight of the stroke (in pixels)
* @chainable
Expand All @@ -348,8 +351,21 @@ p5.prototype.strokeJoin = function(join) {
* </code>
* </div>
*
* <div>
* <code>
* //Example of stroke weights
* //after transformations
* strokeWeight(1); // Default
* line(20, 20, 80, 20);
* scale(5); // Adding scale transformation
* strokeWeight(1); // Resulting strokeweight is 5
* line(4, 8, 16, 8); // Coordinates adjusted for scaling
* </code>
* </div>
*
* @alt
* 3 horizontal black lines. Top line: thin, mid: medium, bottom:thick.
* 2 horizontal black line. Top line: thin, botton line: 5 times thicker than top
*/
p5.prototype.strokeWeight = function(w) {
p5._validateParameters('strokeWeight', arguments);
Expand Down