p5PlayGround icon indicating copy to clipboard operation
p5PlayGround copied to clipboard

Suggestion: Add ">0" restriction on height and weight

Open zhuth opened this issue 9 years ago • 0 comments

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.

zhuth avatar Jun 17 '16 00:06 zhuth