Issue: Grey Background on Shapes When Moved or Scaled
When I draw a shape, such as an ellipse, line, or rectangle, and move or scale it, the background turns grey. I attempted to change the stroke weight and fill arguments, but the issue persisted.
The following code can be used to reproduce the issue:
var bodys = [];
var zoom = 1.00;
var zMin = 0.05;
var zMax = 9.00;
var sensativity = 0.005;
let zoomMultiplier = 50000000;
function mouseWheel(event) {
zoom += sensativity * -event.delta;
zoom = constrain(zoom, zMin, zMax);
return false;
}
function setup() {
createCanvas(windowWidth, windowHeight);
rectMode(CENTER);
//declaring objects[], replacing these with normal ellipses works
//if you're trying to reproduce it.
background(0);
}
function draw() {
background(0, 20);
translate(width/2, height/2);
scale(zoom / zoomMultiplier);
strokeWeight(500000)
line(bodys[0].pos.x, bodys[0].pos.y, bodys[1].pos.x, bodys[1].pos.y)
//...
for (let bodys of bodys) {
bodys.show()
}
}
The show function looks like this:
show() {
stroke(255);
strokeWeight(2);
fill(255, 100);
ellipse(this.pos.x, this.pos.y, this.r * 2);
}
Example of the issue.