p5py/p5

Unexpected behavior of size() in setup()

Closed this issue · 4 comments

This is a more descriptive continuation of #372

Describe the bug
Any Shape, background(),etc. when called together with size() in setup() produces unexpected outcomes. With background() and size() together in setup() the background is not changed, in case of a 2D Primitive like circle() the circle is not visible.

To Reproduce
Run the following codes:

from p5 import *

def setup():
    size(512,512)
    circle(100,100,50)

run(renderer="skia")  # Also with run()

Expected behavior
A 512x512 size window with a circle at (100,100).

Actual behavior
Screenshot from 2023-02-19 05-16-47
Commenting out size():
Screenshot from 2023-02-19 05-17-25

from p5 import *

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

run(renderer="skia")  # Also with run()

Expected behavior
A 512x512 size window with a white(255) background.

Actual behavior
Screenshot from 2023-02-19 05-16-08
Commenting out size():
Screenshot from 2023-02-19 05-22-29

System information:

  • p5 release: 0.8.2
  • Python version: 3.10.6
  • Operating system: Ubuntu 22.04.1 LTS (64-bit)

Thank you for submitting your first issue to p5py

I would like to work on this issue.

I assume this is something related to setup logic in skia renderer. The swapping of framebuffers is not being done right, I think. You can start looking from there.

Close by #420