Skip to content

Commit

Permalink
Merge pull request #2520 from Spongman/docs
Browse files Browse the repository at this point in the history
more yui docs tweaks
  • Loading branch information
lmccart authored Jan 8, 2018
2 parents 6488203 + 8662cfd commit 99c35e1
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/core/2d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ p5.prototype.quad = function() {
* @param {Number} [tr] optional radius of top-right corner.
* @param {Number} [br] optional radius of bottom-right corner.
* @param {Number} [bl] optional radius of bottom-left corner.
* @return {p5} the p5 object.
* @chainable
* @example
* <div>
* <code>
Expand Down
2 changes: 1 addition & 1 deletion src/core/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ p5.prototype.strokeJoin = function(join) {
*
* @method strokeWeight
* @param {Number} weight the weight (in pixels) of the stroke
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down
67 changes: 40 additions & 27 deletions src/core/curves.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require('./error_helpers');
* @param {Number} y3 y-coordinate for the second control point
* @param {Number} x4 x-coordinate for the second anchor point
* @param {Number} y4 y-coordinate for the second anchor point
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand All @@ -42,6 +42,16 @@ require('./error_helpers');
* bezier(85, 20, 10, 10, 90, 90, 15, 80);
* </code>
* </div>
*
* <div>
* <code>
* background(0, 0, 0);
* noFill();
* stroke(255);
* bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0);
* </code>
* </div>
*
* @alt
* stretched black s-shape in center with orange lines extending from end points.
* stretched black s-shape with 10 5x5 white ellipses along the shape.
Expand All @@ -55,20 +65,19 @@ require('./error_helpers');
*/
/**
* @method bezier
* @param {Number} x1
* @param {Number} y1
* @param {Number} z1 z-coordinate for the first anchor point
* @param {Number} x2
* @param {Number} y2
* @param {Number} z2 z-coordinate for the first control point
* @param {Number} z3 z-coordinate for the first anchor point
* @param {Number} z4 z-coordinate for the first control point
* @param {Number} x3
* @param {Number} y3
* @param {Number} z3 z-coordinate for the second control point
* @param {Number} x4
* @param {Number} y4
* @param {Number} z4 z-coordinate for the second anchor point
* @chainable
* @example
* <div>
* <code>
*background(0, 0, 0);
*noFill();
*stroke(255);
*bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0);
* </code>
* </div>
*/
p5.prototype.bezier = function() {
p5._validateParameters('bezier', arguments);
Expand Down Expand Up @@ -260,7 +269,7 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
* @param {Number} y3 y-coordinate for the second point
* @param {Number} x4 x-coordinate for the ending control point
* @param {Number} y4 y-coordinate for the ending control point
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down Expand Up @@ -289,20 +298,6 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
* curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y);
* </code>
* </div>
*
* @alt
* horseshoe shape with orange ends facing left and black curved center.
* horseshoe shape with orange ends facing left and black curved center.
*
*/
/**
* @method curve
* @param {Number} z1 z-coordinate for the beginning control point
* @param {Number} z2 z-coordinate for the first point
* @param {Number} z3 z-coordinate for the second point
* @param {Number} z4 z-coordinate for the ending control point
* @chainable
* @example
* <div>
* <code>
* noFill();
Expand All @@ -316,8 +311,26 @@ p5.prototype.bezierTangent = function(a, b, c, d, t) {
* </div>
*
* @alt
* horseshoe shape with orange ends facing left and black curved center.
* horseshoe shape with orange ends facing left and black curved center.
* curving black and orange lines.
*/
/**
* @method curve
* @param {Number} x1
* @param {Number} y1
* @param {Number} z1 z-coordinate for the beginning control point
* @param {Number} x2
* @param {Number} y2
* @param {Number} z2 z-coordinate for the first point
* @param {Number} x3
* @param {Number} y3
* @param {Number} z3 z-coordinate for the second point
* @param {Number} x4
* @param {Number} y4
* @param {Number} z4 z-coordinate for the ending control point
* @chainable
*/
p5.prototype.curve = function() {
p5._validateParameters('curve', arguments);

Expand Down
4 changes: 2 additions & 2 deletions src/events/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ p5.prototype.mouseX = 0;
* function draw() {
* background(244, 248, 252);
* line(0, mouseY, 100, mouseY);
*}
* }
* </code>
* </div>
*
Expand Down Expand Up @@ -179,7 +179,7 @@ p5.prototype.winMouseX = 0;
* @example
* <div>
* <code>
*var myCanvas;
* var myCanvas;
*
* function setup() {
* //use a variable to store a pointer to the canvas
Expand Down
10 changes: 5 additions & 5 deletions src/math/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ p5.prototype.random = function(min, max) {
* </div>
* <div>
* <code>
*var distribution = new Array(360);
* var distribution = new Array(360);
*
*function setup() {
* function setup() {
* createCanvas(100, 100);
* for (var i = 0; i < distribution.length; i++) {
* distribution[i] = floor(randomGaussian(0, 15));
* }
*}
* }
*
*function draw() {
* function draw() {
* background(204);
*
* translate(width / 2, width / 2);
Expand All @@ -212,7 +212,7 @@ p5.prototype.random = function(min, max) {
* var dist = abs(distribution[i]);
* line(0, 0, dist, 0);
* }
*}
* }
* </code>
* </div>
* @alt
Expand Down
2 changes: 1 addition & 1 deletion src/typography/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ p5.prototype.loadFont = function(path, onSuccess, onError) {
* see rectMode() for more info
* @param {Number} [y2] by default, the height of the text box,
* see rectMode() for more info
* @return {p5} this
* @chainable
* @example
* <div>
* <code>
Expand Down
6 changes: 3 additions & 3 deletions src/webgl/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var p5 = require('../core/core');
* @param {Number} [upX] x component of direction 'up' from camera
* @param {Number} [upY] y component of direction 'up' from camera
* @param {Number} [upZ] z component of direction 'up' from camera
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down Expand Up @@ -167,7 +167,7 @@ p5.RendererGL.prototype.camera = function(
* @param {Number} [aspect] camera frustum aspect ratio
* @param {Number} [near] frustum near plane length
* @param {Number} [far] frustum far plane length
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down Expand Up @@ -245,7 +245,7 @@ p5.RendererGL.prototype.perspective = function(fovy, aspect, near, far) {
* @param {Number} [top] camera frustum top plane
* @param {Number} [near] camera frustum near plane
* @param {Number} [far] camera frustum far plane
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down
2 changes: 1 addition & 1 deletion src/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ p5.RendererGL.prototype.background = function() {
* @param {Number} [v2] green or saturation value
* @param {Number} [v3] blue or brightness value
* @param {Number} [a] opacity
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down
2 changes: 1 addition & 1 deletion src/webgl/primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require('./p5.Geometry');
* subdivisions in x-dimension
* @param {Number} [detailY] Optional number of triangle
* subdivisions in y-dimension
* @return {p5} the p5 object
* @chainable
* @example
* <div>
* <code>
Expand Down

0 comments on commit 99c35e1

Please sign in to comment.