Skip to content

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

Open

Description

@SableRaf

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

Activity

  1. rishabdev2997 commented on Apr 5, 2025

    @rishabdev2997

    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?

  2. SableRaf commented on Apr 5, 2025

    @SableRaf
    CollaboratorAuthor

    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.

  3. rishabdev2997 commented on Apr 6, 2025

    @rishabdev2997

    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!

  4. Pratik5252 commented on Oct 7, 2025

    @Pratik5252

    @rishabdev2997 are you still working on this issue?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions