Skip to content

Commit

Permalink
Merge pull request #5519 from aferriss/texture-accept-texture
Browse files Browse the repository at this point in the history
Allow texture() to accept p5.Texture argument without throwing a warning.
  • Loading branch information
stalgiag committed Dec 30, 2021
2 parents f8a62f7 + d2c1001 commit d28b8ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/image/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function _sAssign(sVal, iVal) {
* <img src="assets/drawImage.png"></img>
*
* @method image
* @param {p5.Image|p5.Element} img the image to display
* @param {p5.Image|p5.Element|p5.Texture} img the image to display
* @param {Number} x the x-coordinate of the top-left corner of the image
* @param {Number} y the y-coordinate of the top-left corner of the image
* @param {Number} [width] the width to draw the image
Expand Down Expand Up @@ -387,7 +387,7 @@ function _sAssign(sVal, iVal) {
*/
/**
* @method image
* @param {p5.Image|p5.Element} img
* @param {p5.Image|p5.Element|p5.Texture} img
* @param {Number} dx the x-coordinate of the destination
* rectangle in which to draw the source image
* @param {Number} dy the y-coordinate of the destination
Expand Down
2 changes: 1 addition & 1 deletion src/webgl/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ p5.prototype.resetShader = function() {
* <a href="https://p5js.org/examples/3d-materials.html">example</a>.
*
* @method texture
* @param {p5.Image|p5.MediaElement|p5.Graphics} tex image to use as texture
* @param {p5.Image|p5.MediaElement|p5.Graphics|p5.Texture} tex image to use as texture
* @chainable
* @example
* <div>
Expand Down

0 comments on commit d28b8ca

Please sign in to comment.