void setup() { size(500, 400); } void draw() { background(255); float w = 2*abs(mouseX - 0.5*width); float h = 2*abs(mouseY - 0.5*height); noFill(); rect(0.5*width - 0.5*w, 0.5*height - 0.5*h, w, h); fill(128, 128, 255); ellipse(0.5*width, 0.5*height, w, h); }