Skip to content

Commit 1e2334e

Browse files
authored
Merge pull request #5480 from reejuBhattacharya/main
Updated strokeWeight() documentation
2 parents e79d589 + 152ea36 commit 1e2334e

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/shape/attributes.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ p5.prototype.strokeJoin = function(join) {
332332
* Sets the width of the stroke used for lines, points and the border around
333333
* shapes. All widths are set in units of pixels.
334334
*
335+
* Note that it is affected by any transformation or scaling that has
336+
* been applied previously.
337+
*
335338
* @method strokeWeight
336339
* @param {Number} weight the weight of the stroke (in pixels)
337340
* @chainable
@@ -348,8 +351,21 @@ p5.prototype.strokeJoin = function(join) {
348351
* </code>
349352
* </div>
350353
*
354+
* <div>
355+
* <code>
356+
* //Example of stroke weights
357+
* //after transformations
358+
* strokeWeight(1); // Default
359+
* line(20, 20, 80, 20);
360+
* scale(5); // Adding scale transformation
361+
* strokeWeight(1); // Resulting strokeweight is 5
362+
* line(4, 8, 16, 8); // Coordinates adjusted for scaling
363+
* </code>
364+
* </div>
365+
*
351366
* @alt
352367
* 3 horizontal black lines. Top line: thin, mid: medium, bottom:thick.
368+
* 2 horizontal black line. Top line: thin, botton line: 5 times thicker than top
353369
*/
354370
p5.prototype.strokeWeight = function(w) {
355371
p5._validateParameters('strokeWeight', arguments);

0 commit comments

Comments
 (0)