Skip to content

Commit 513fe1f

Browse files
committed
Fixes #2678
Now the text function calls validateParamenters() to print a friendy error in case the arguments of the function are invalide (e.g., text is undefined, wrong type, etc).
1 parent 590950c commit 513fe1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/typography/loading_displaying.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ p5.prototype.loadFont = function(path, onSuccess, onError) {
191191
*
192192
*/
193193
p5.prototype.text = function(str, x, y, maxWidth, maxHeight) {
194+
p5._validateParameters('text', arguments);
194195
return !(this._renderer._doFill || this._renderer._doStroke)
195196
? this
196197
: this._renderer.text.apply(this._renderer, arguments);

0 commit comments

Comments
 (0)