-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Shape point() does not work with scale > 1, strokeWeight < 1 #4707
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
The issue is in https://github.com/processing/p5.js/blob/main/src/core/p5.Renderer2D.js#L559 from line 559 where lineWidth is checked, presumably as a scaled value, but then fillRect is used with hardcoded width=1, height=1 without regard to scaling. |
I could invent some amendment to that function in p5.Renderer2D.js, but I am relatively new to p5js and certainly to the actual code behind it, and I don't know whether this is by design, or what the implications are for a very local change there. Would other parts change behaviour, or break? Maybe the performance would suffer greatly? |
Hi @ednl, I looked into the change history of the repository, and I couldn't find any reason the conditional statement on line 559 is needed. Also, the unit test for my changes passed with a small change. So I believe this library can allow your case and created the PR #4756 to allow drawing a point with strokeWeight < 1. |
@TakumaKira Fantastic, thanks. |
Most appropriate sub-area of p5.js
Details about the bug:
The resulting picture, which should have one blue pixel in the centre, not a large blue square:
The text was updated successfully, but these errors were encountered: