processing / processing/libprocessing

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

未關閉
#125 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug
主要語言
Rust
星號
69
分支
14
平均合併
15 天 22 小時
30 天內合併 PR
3

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先使用報告中的 setup()、draw() 和 run() 範例重現問題,然後追蹤 setup() 與 draw() 之間的算繪生命週期。確認實作後的行為會讓 setup() 中的白色背景保持顯示在紅色矩形下方,與 Processing Java 一致。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python, rust
領域
computer-graphics
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
56/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。