MCPcopy
hub / github.com/processing/p5.js / _sAssign

Function _sAssign

src/image/loading_displaying.js:837–843  ·  view source on GitHub ↗

* Validates clipping params. Per drawImage spec sWidth and sHight cannot be * negative or greater than image intrinsic width and height * @private * @param {Number} sVal * @param {Number} iVal * @returns {Number} * @private

(sVal, iVal)

Source from the content-addressed store, hash-verified

835 * @private
836 */
837 function _sAssign(sVal, iVal) {
838 if (sVal > 0 && sVal < iVal) {
839 return sVal;
840 } else {
841 return iVal;
842 }
843 }
844
845 /**
846 * Draws an image to the canvas.

Callers 1

loadingDisplayingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected