Skip to content

Commit 99c35e1

Browse files
authored
Merge pull request #2520 from Spongman/docs
more yui docs tweaks
2 parents 6488203 + 8662cfd commit 99c35e1

File tree

9 files changed

+55
-42
lines changed

9 files changed

+55
-42
lines changed

src/core/2d_primitives.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ p5.prototype.quad = function() {
353353
* @param {Number} [tr] optional radius of top-right corner.
354354
* @param {Number} [br] optional radius of bottom-right corner.
355355
* @param {Number} [bl] optional radius of bottom-left corner.
356-
* @return {p5} the p5 object.
356+
* @chainable
357357
* @example
358358
* <div>
359359
* <code>

src/core/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ p5.prototype.strokeJoin = function(join) {
316316
*
317317
* @method strokeWeight
318318
* @param {Number} weight the weight (in pixels) of the stroke
319-
* @return {p5} the p5 object
319+
* @chainable
320320
* @example
321321
* <div>
322322
* <code>

src/core/curves.js

+40-27
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require('./error_helpers');
3030
* @param {Number} y3 y-coordinate for the second control point
3131
* @param {Number} x4 x-coordinate for the second anchor point
3232
* @param {Number} y4 y-coordinate for the second anchor point
33-
* @return {p5} the p5 object
33+
* @chainable
3434
* @example
3535
* <div>
3636
* <code>
@@ -42,6 +42,16 @@ require('./error_helpers');
4242
* bezier(85, 20, 10, 10, 90, 90, 15, 80);
4343
* </code>
4444
* </div>
45+
*
46+
* <div>
47+
* <code>
48+
* background(0, 0, 0);
49+
* noFill();
50+
* stroke(255);
51+
* bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0);
52+
* </code>
53+
* </div>
54+
*
4555
* @alt
4656
* stretched black s-shape in center with orange lines extending from end points.
4757
* stretched black s-shape with 10 5x5 white ellipses along the shape.
@@ -55,20 +65,19 @@ require('./error_helpers');
5565
*/
5666
/**
5767
* @method bezier
68+
* @param {Number} x1
69+
* @param {Number} y1
5870
* @param {Number} z1 z-coordinate for the first anchor point
71+
* @param {Number} x2
72+
* @param {Number} y2
5973
* @param {Number} z2 z-coordinate for the first control point
60-
* @param {Number} z3 z-coordinate for the first anchor point
61-
* @param {Number} z4 z-coordinate for the first control point
74+
* @param {Number} x3
75+
* @param {Number} y3
76+
* @param {Number} z3 z-coordinate for the second control point
77+
* @param {Number} x4
78+
* @param {Number} y4
79+
* @param {Number} z4 z-coordinate for the second anchor point
6280
* @chainable
63-
* @example
64-
* <div>
65-
* <code>
66-
*background(0, 0, 0);
67-
*noFill();
68-
*stroke(255);
69-
*bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0);
70-
* </code>
71-
* </div>
7281
*/
7382
p5.prototype.bezier = function() {
7483
p5._validateParameters('bezier', arguments);
@@ -260,7 +269,7 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
260269
* @param {Number} y3 y-coordinate for the second point
261270
* @param {Number} x4 x-coordinate for the ending control point
262271
* @param {Number} y4 y-coordinate for the ending control point
263-
* @return {p5} the p5 object
272+
* @chainable
264273
* @example
265274
* <div>
266275
* <code>
@@ -289,20 +298,6 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
289298
* curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y);
290299
* </code>
291300
* </div>
292-
*
293-
* @alt
294-
* horseshoe shape with orange ends facing left and black curved center.
295-
* horseshoe shape with orange ends facing left and black curved center.
296-
*
297-
*/
298-
/**
299-
* @method curve
300-
* @param {Number} z1 z-coordinate for the beginning control point
301-
* @param {Number} z2 z-coordinate for the first point
302-
* @param {Number} z3 z-coordinate for the second point
303-
* @param {Number} z4 z-coordinate for the ending control point
304-
* @chainable
305-
* @example
306301
* <div>
307302
* <code>
308303
* noFill();
@@ -316,8 +311,26 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
316311
* </div>
317312
*
318313
* @alt
314+
* horseshoe shape with orange ends facing left and black curved center.
315+
* horseshoe shape with orange ends facing left and black curved center.
319316
* curving black and orange lines.
320317
*/
318+
/**
319+
* @method curve
320+
* @param {Number} x1
321+
* @param {Number} y1
322+
* @param {Number} z1 z-coordinate for the beginning control point
323+
* @param {Number} x2
324+
* @param {Number} y2
325+
* @param {Number} z2 z-coordinate for the first point
326+
* @param {Number} x3
327+
* @param {Number} y3
328+
* @param {Number} z3 z-coordinate for the second point
329+
* @param {Number} x4
330+
* @param {Number} y4
331+
* @param {Number} z4 z-coordinate for the ending control point
332+
* @chainable
333+
*/
321334
p5.prototype.curve = function() {
322335
p5._validateParameters('curve', arguments);
323336

src/events/mouse.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ p5.prototype.mouseX = 0;
6161
* function draw() {
6262
* background(244, 248, 252);
6363
* line(0, mouseY, 100, mouseY);
64-
*}
64+
* }
6565
* </code>
6666
* </div>
6767
*
@@ -179,7 +179,7 @@ p5.prototype.winMouseX = 0;
179179
* @example
180180
* <div>
181181
* <code>
182-
*var myCanvas;
182+
* var myCanvas;
183183
*
184184
* function setup() {
185185
* //use a variable to store a pointer to the canvas

src/math/random.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ p5.prototype.random = function(min, max) {
192192
* </div>
193193
* <div>
194194
* <code>
195-
*var distribution = new Array(360);
195+
* var distribution = new Array(360);
196196
*
197-
*function setup() {
197+
* function setup() {
198198
* createCanvas(100, 100);
199199
* for (var i = 0; i < distribution.length; i++) {
200200
* distribution[i] = floor(randomGaussian(0, 15));
201201
* }
202-
*}
202+
* }
203203
*
204-
*function draw() {
204+
* function draw() {
205205
* background(204);
206206
*
207207
* translate(width / 2, width / 2);
@@ -212,7 +212,7 @@ p5.prototype.random = function(min, max) {
212212
* var dist = abs(distribution[i]);
213213
* line(0, 0, dist, 0);
214214
* }
215-
*}
215+
* }
216216
* </code>
217217
* </div>
218218
* @alt

src/typography/loading_displaying.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ p5.prototype.loadFont = function(path, onSuccess, onError) {
165165
* see rectMode() for more info
166166
* @param {Number} [y2] by default, the height of the text box,
167167
* see rectMode() for more info
168-
* @return {p5} this
168+
* @chainable
169169
* @example
170170
* <div>
171171
* <code>

src/webgl/camera.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var p5 = require('../core/core');
2727
* @param {Number} [upX] x component of direction 'up' from camera
2828
* @param {Number} [upY] y component of direction 'up' from camera
2929
* @param {Number} [upZ] z component of direction 'up' from camera
30-
* @return {p5} the p5 object
30+
* @chainable
3131
* @example
3232
* <div>
3333
* <code>
@@ -167,7 +167,7 @@ p5.RendererGL.prototype.camera = function(
167167
* @param {Number} [aspect] camera frustum aspect ratio
168168
* @param {Number} [near] frustum near plane length
169169
* @param {Number} [far] frustum far plane length
170-
* @return {p5} the p5 object
170+
* @chainable
171171
* @example
172172
* <div>
173173
* <code>
@@ -245,7 +245,7 @@ p5.RendererGL.prototype.perspective = function(fovy, aspect, near, far) {
245245
* @param {Number} [top] camera frustum top plane
246246
* @param {Number} [near] camera frustum near plane
247247
* @param {Number} [far] camera frustum far plane
248-
* @return {p5} the p5 object
248+
* @chainable
249249
* @example
250250
* <div>
251251
* <code>

src/webgl/p5.RendererGL.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ p5.RendererGL.prototype.background = function() {
445445
* @param {Number} [v2] green or saturation value
446446
* @param {Number} [v3] blue or brightness value
447447
* @param {Number} [a] opacity
448-
* @return {p5} the p5 object
448+
* @chainable
449449
* @example
450450
* <div>
451451
* <code>

src/webgl/primitives.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require('./p5.Geometry');
1919
* subdivisions in x-dimension
2020
* @param {Number} [detailY] Optional number of triangle
2121
* subdivisions in y-dimension
22-
* @return {p5} the p5 object
22+
* @chainable
2323
* @example
2424
* <div>
2525
* <code>

0 commit comments

Comments
 (0)