javascript - My p5.js canvas window continues to change with each code execution. How can I stop this? -
i downloaded p5.js editor earlier today , i've been playing around fun. i've noticed when using createcanvas(), time resulting window correct size first time execute code. every subsequent time, window height decreases small amount, , window width increases similar amount.
below code:
function setup() { createcanvas(600, 400); } function draw() { background(0); strokeweight(4); stroke(255); //create rows of circles thick white outline across entirety of canvas //their x , y values used create static random variation in color (r, g, b) (var y = 0; y <= height; y += 50) { (var x = 0; x <= width; x += 50) { fill(x%255, (x*y)%255, y%255); ellipse(x, y, 25, 25); } } }
here window looks after code's first execution. dimensions of window match dimensions of canvas perfectly.
here window looks after closing , executing code 3 times. deformation of window continues in way until literally title bar left.
the problem persists while using createcanvas(displaywidth, displayheight)
i have latest build of p5.js editor windows (currently 0.5.10), , running on windows 10. cannot find reports of other users issue, feel kind of stuck. it's not huge issue it's inconvenient enough annoying.
what causing , how can fix it?
thanks help!
this appears bug. i've filed bug report here. feel free add details left out.
the editor download page says this:
the p5.js editor in development, try out beta version of now. out posting feedback , bugs.
for go settings (the little gear icon in upper-right corner of editor) , change "run in browser" setting "on". cause sketches launch in browser instead of in popup window.