Skip to content

Commit 49baf54

Browse files
committed
endContour default mode update
1 parent e605b54 commit 49baf54

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/shape/custom_shapes.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ class Shape {
832832
splineProperty(key, value) {
833833
this._splineProperties[key] = value;
834834
}
835-
835+
836836
splineProperties(values) {
837837
if (values) {
838838
for (const key in values) {
@@ -2371,7 +2371,7 @@ function customShapes(p5, fn) {
23712371
* vertex(30, 70);
23722372
* vertex(70, 70);
23732373
* vertex(70, 30);
2374-
* endContour();
2374+
* endContour(CLOSE);
23752375
*
23762376
* // Stop drawing the shape.
23772377
* endShape(CLOSE);
@@ -2412,7 +2412,7 @@ function customShapes(p5, fn) {
24122412
* vertex(-20, 20);
24132413
* vertex(20, 20);
24142414
* vertex(20, -20);
2415-
* endContour();
2415+
* endContour(CLOSE);
24162416
*
24172417
* // Stop drawing the shape.
24182418
* endShape(CLOSE);
@@ -2425,7 +2425,7 @@ function customShapes(p5, fn) {
24252425
};
24262426

24272427
/**
2428-
* Stops creating a hole within a flat shape.
2428+
* Stops creating a hole within a flat shape.
24292429
*
24302430
* The <a href="#/p5/beginContour">beginContour()</a> and `endContour()`
24312431
* functions allow for creating negative space within custom shapes that are
@@ -2435,6 +2435,10 @@ function customShapes(p5, fn) {
24352435
* called between <a href="#/p5/beginShape">beginShape()</a> and
24362436
* <a href="#/p5/endShape">endShape()</a>.
24372437
*
2438+
* By default,
2439+
* the controur has an `OPEN` end, and to close it,
2440+
* call `endContour(CLOSE)`.
2441+
*
24382442
* Transformations such as <a href="#/p5/translate">translate()</a>,
24392443
* <a href="#/p5/rotate">rotate()</a>, and <a href="#/p5/scale">scale()</a>
24402444
* don't work between <a href="#/p5/beginContour">beginContour()</a> and
@@ -2448,7 +2452,7 @@ function customShapes(p5, fn) {
24482452
* counter-clockwise order.
24492453
*
24502454
* @method endContour
2451-
* @param {OPEN|CLOSE} [mode=OPEN]
2455+
* @param {OPEN|CLOSE} [mode=OPEN] By default, the value is OPEN
24522456
*
24532457
* @example
24542458
* <div>
@@ -2473,7 +2477,7 @@ function customShapes(p5, fn) {
24732477
* vertex(30, 70);
24742478
* vertex(70, 70);
24752479
* vertex(70, 30);
2476-
* endContour();
2480+
* endContour(CLOSE);
24772481
*
24782482
* // Stop drawing the shape.
24792483
* endShape(CLOSE);
@@ -2514,7 +2518,7 @@ function customShapes(p5, fn) {
25142518
* vertex(-20, 20);
25152519
* vertex(20, 20);
25162520
* vertex(20, -20);
2517-
* endContour();
2521+
* endContour(CLOSE);
25182522
*
25192523
* // Stop drawing the shape.
25202524
* endShape(CLOSE);

0 commit comments

Comments
 (0)