jonathanperret / paysage

Paysage is a visual shared playground for code.
http://paysage.xyz
GNU Affero General Public License v3.0
19 stars 9 forks source link

Grey background is back when error code in setup #76

Closed etienneCharignon closed 7 years ago

etienneCharignon commented 7 years ago

In cas you make a syntax error in the setup function, you get no creature but a grey background covering the full playground and all code objects in layers below.

For example, add a correct code object to the playground and then create an object with the following code.

void setup() {
    noStroke()
    syntaxError
}

void draw() {
    background (0)

    var deplacement = sin (millis()/50) * 20
    translate (deplacement, 30)

    fill (10, 50, 10, 10)
    rect (10, 10, 100, 100)
}
juliendorra commented 7 years ago

to narrow it down: if you have a background set up before the syntax error in setup(), the background is correctly set. (but not after, as obviously it's never ran)

Exemple, this lead a transparent background

void setup() {
    background (0, 0)
    noStroke()
    syntaxError
}

void draw() {
    background (0)

    var deplacement = sin (millis()/50) * 20
    translate (deplacement, 30)

    fill (10, 50, 10, 10)
    rect (10, 10, 100, 100)
}