-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.2.0
Web browser and version
Google chrome Version 144.0.7559.133
Operating system
Windows 11
Steps to reproduce this
Steps:
- Create WEBGL canvas
- Call ellipse()
- Pass a negative detail value
Snippet:
function setup() {
createCanvas(200, 200, WEBGL);
noLoop();
}
function draw() {
ellipse(0, 0, 100, 100, -10);
}
Observed Behaviour:
Sketch crashes when ellipse() is called with negative detail.
Renderer stops and runtime exception occurs.
Expected Behaviour:
Negative detail values should not crash the renderer.
Possible alternatives:
• Clamp to minimum valid value
• Ignore invalid input
• Throw friendly error
Additional Note
Tested with:
- ellipse(..., -1)
- ellipse(..., -10)
- ellipse(..., -100)
All resulted in crash.
I'm willing to implement a fix if this gets approved.
Reactions are currently unavailable