processing / processing/libprocessing

`background()` in `setup()` does not persist

Open
#125 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
69
Forks
14
Avg merge
15d 22h
Merged PRs (30d)
3

Description

In Processing (Java), calling background() inside setup() sets the initial canvas background, which remains visible unless explicitly changed in draw().

In libprocessing / mewnala, calling background() inside setup() appears to have no effect once draw() starts.

Example
from mewnala import *

def setup():
    size(600, 600)
    background(255)

def draw():
    fill(255, 0, 0)
    rect(100, 100, 200, 200)

run()

See screenshot below for output.

Expected behavior (Processing Java)

White background with a red rectangle drawn on top.

Actual behavior (libprocessing / mewnala)

Black background with a red rectangle, suggesting the background set in setup() is cleared or ignored when draw() runs.

Screenshot
Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the setup(), draw(), and run() example from the report, then trace the render lifecycle between setup() and draw(). Confirm that the completed behavior keeps the white background from setup() visible beneath the red rectangle, matching Processing Java.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.