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