-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rect() : inputting negative values for width and height doesn't yield a flipped rectangle anymore...absolute values of width and height are considered #7353
Comments
Just spotted this. Pretty poor regression. |
This was changed in #7290. Before considering this a regression we want to fix (a negative width is arguably undefined behaviour?), @martinleopold and @ff6347 do you have opinions on what the expected behaviour here should be? |
@davepagurek upon double checking, I'm not sure that is where the change happened, as the changes in that PR is for arcs. however, comparing 1.11.0 (which works) and 1.11.1, i can't see anywhere else that might of caused this regression/change |
I believe |
Also ccing the rendering stewards in case anyone has thoughts: @limzykenneth, @ChihYungChang, @teragramgius, @tuminzee, @Zarkv, @robin-haxx, @Gaurav-1306 |
I think this was caused by my PR. It's pretty much undefined behaviour as the reference doesn't talk about negative widths and heights. Some comments in the code were mentioning "p5 supports negative width and heights for rect" but not more. Note that prior to my PR there were virtually no tests for the basic shape rendering/and shape modes, so no 'defined' behaviour in that regard. Using negative width/height to flip rectangle/ellipse/arc does make sense to me though – for rectMode(CORNER) at least. I think we should revert to this behaviour and use the opportunity to update the docs accordingly as well. |
Negative height and width has been part of p5js for as long as I can remember. This is certainly an accidental regression and a breaking change. It makes 1000% sense as it's the easiest way to draw rectangles from the bottom up due to p5's "odd" coordinate system |
Yes, it is a regression in this case. Feel free to file a PR for a fix. |
I just ran into this too – I usually render FFT audio bars with something like |
Only applicable to shape mode `CORNER` Fixes processing#7353
Most appropriate sub-area of p5.js?
p5.js version
v1.11.1
Web browser and version
129.0.6668.112
Operating system
ChromeOS
Steps to reproduce this
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: