@@ -123,14 +123,15 @@ p5.prototype.arc = function(x, y, w, h, start, stop, mode) {
123123/**
124124 * Draws an ellipse (oval) to the screen. An ellipse with equal width and
125125 * height is a circle. By default, the first two parameters set the location,
126- * and the third and fourth parameters set the shape's width and height. The
127- * origin may be changed with the ellipseMode() function.
126+ * and the third and fourth parameters set the shape's width and height. If
127+ * no height is specified, the value of width is used for both the width and
128+ * height. The origin may be changed with the ellipseMode() function.
128129 *
129130 * @method ellipse
130131 * @param {Number } x x-coordinate of the ellipse.
131132 * @param {Number } y y-coordinate of the ellipse.
132133 * @param {Number } w width of the ellipse.
133- * @param {Number } h height of the ellipse.
134+ * @param {Number } [h] height of the ellipse.
134135 * @return {p5 } the p5 object
135136 * @example
136137 * <div>
@@ -145,14 +146,18 @@ p5.prototype.arc = function(x, y, w, h, start, stop, mode) {
145146 * @param {Number } y
146147 * @param {Number } z z-coordinate of the ellipse
147148 * @param {Number } w
148- * @param {Number } h
149+ * @param {Number } [h]
149150 * @return {p5 }
150151 */
151152p5 . prototype . ellipse = function ( ) {
152153 var args = new Array ( arguments . length ) ;
153154 for ( var i = 0 ; i < args . length ; ++ i ) {
154155 args [ i ] = arguments [ i ] ;
155156 }
157+ // Duplicate 3rd argument if onl 3 given.
158+ if ( args . length === 3 ) {
159+ args . push ( args [ 2 ] ) ;
160+ }
156161 if ( this . _renderer . isP3D ) {
157162 // p5 supports negative width and heights for ellipses
158163 if ( args [ 3 ] < 0 ) { args [ 3 ] = Math . abs ( args [ 3 ] ) ; }
@@ -314,9 +319,17 @@ p5.prototype.point = function() {
314319 */
315320/**
316321 * @method quad
322+ * @param {Number } x1
323+ * @param {Number } y1
317324 * @param {Number } z1 the z-coordinate of the first point
325+ * @param {Number } x2
326+ * @param {Number } y2
318327 * @param {Number } z2 the z-coordinate of the second point
328+ * @param {Number } x3
329+ * @param {Number } y3
319330 * @param {Number } z3 the z-coordinate of the third point
331+ * @param {Number } x4
332+ * @param {Number } y4
320333 * @param {Number } z4 the z-coordinate of the fourth point
321334 * @return {p5 } the p5 object
322335 */
@@ -405,7 +418,15 @@ p5.prototype.quad = function() {
405418*/
406419/**
407420* @method rect
421+ * @param {Number } x
422+ * @param {Number } y
408423* @param {Number } z z-coordinate of the rectangle.
424+ * @param {Number } w
425+ * @param {Number } h
426+ * @param {Number } [tl]
427+ * @param {Number } [tr]
428+ * @param {Number } [br]
429+ * @param {Number } [bl]
409430* @return {p5 } the p5 object.
410431*/
411432p5 . prototype . rect = function ( ) {
0 commit comments