function setup() {
createCanvas(600, 400);
}
function draw() {
background(0);
ellipse(mouseX, mouseY, 25, 25);
}
The code works okay the first time I run it. I close the window, don't make any changes to the code, and run it again. Now the width will be slightly smaller, and the height will be slightly larger. This adds up over runs, so by the 10th time I'm running it, my sketch is a different size than what I'm giving it.
Originally found in this Stack Overflow question: http://stackoverflow.com/questions/37671632/my-p5-js-canvas-window-continues-to-change-with-each-code-execution-how-can-i-s
I see the same issue on Windows 7.
If I have some simple code:
The code works okay the first time I run it. I close the window, don't make any changes to the code, and run it again. Now the width will be slightly smaller, and the height will be slightly larger. This adds up over runs, so by the 10th time I'm running it, my sketch is a different size than what I'm giving it.