Skip to content

Visual mismatch between Array example and corresponding liveSketch.js #622

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

Open
SableRaf opened this issue Mar 27, 2025 · 3 comments
Open

Comments

@SableRaf
Copy link
Collaborator

Select the most appropriate label(s) for this issue.

No response

Describe the bug

The look of the live example for Array does not match the output of the original Processing code.

Location: content/examples/Basics/Arrays/Array/liveSketch.js

Expected behavior

The two outputs should look the same.

Adding strokeWeight(2); to the setup seems to fix it.

Screenshots

Image

Browser

Chrome

Browser version

No response

Operating system

macOS

Smartphone details

No response

Additional context

No response

@rishabdev2997
Copy link

Hi @SableRaf ,
The visual mismatch occurs due to the absence of an explicit stroke() declaration in the web example. Adding stroke(255); within the setup() function resolves the issue and ensures the output aligns with the Processing IDE. Including strokeWeight(1) or (2); can further improve consistency across both versions.

This update should effectively address the discrepancy.

Can I go ahead and raise a PR with this solution?

@SableRaf
Copy link
Collaborator Author

SableRaf commented Apr 5, 2025

Hi @rishabdev2997

Thanks for taking the time to suggest a solution. However, it seems that your response missed some important context. Is it possible it was generated by an LLM? 🙂

The livesketch.js sketch actually contains three calls to stroke(), so the solution is not as simple as adding a single stroke(255) declaration, especially in setup() where it would be overwritten by the calls to stroke() in draw().

You might want to take a closer look at the original issue. You could also try to reproduce the behavior in a similar sketch in the p5.js editor for example.

@rishabdev2997
Copy link

Hi @SableRaf,
Yes, I do use an LLM to help with grammar and formatting — it makes my responses cleaner and easier to follow. 🙂
That said, I really appreciate you pointing out the missed context. You're totally right — with multiple stroke() calls in draw(), setting it once in setup() wouldn't have the intended effect. I'll take a closer look at the sketch itself and try reproducing the behavior in the p5.js editor. Thanks again for catching that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants