p5PlayGround
p5PlayGround copied to clipboard
Suggestion: Add ">0" restriction on height and weight
When scaling shapes with mouse in playground mode, setting height/width to zero (and even negative) is now permitted, but this may entail errors like shapes.js:189 Uncaught IndexSizeError: Failed to execute 'ellipse' on 'CanvasRenderingContext2D': The major-axis radius provided (-1.5) is negative, and the browser will refuse to execute subsequent instructions. To avoid this, a greater-than-zero restriction should be introduced in perhaps in line 18-19 in shapes.js. Or, it would be better to show an explicit error message, so that the users may learn from it what is wrong in their code or operation.