function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
}
function draw() {}
function mousePressed() {
fullscreen(true);
background(220);
}
The short version is that just because you used fullscreen(), it doesn’t mean the canvas will change its size. It will only put you into a fullscreen view, while the canvas stays the same size. What you are looking for is a way to resize the canvas. https://p5js.org/reference/#/p5/resizeCanvas
I hope this helps!
(To make the program resize, first enter fullscreen and after that call the function resizeCanvas(). Play around with it a bit and you should be able to make it fit your needs)