When running a simple p5.js sketch, the rendered canvas does not match the actual window size. The canvas appears smaller than the window, leaving empty space at the bottom and right.
Example:
function setup() {
createCanvas(200, 200);
}
function draw() {
background(220);
}
Observed behavior:
The canvas is visibly smaller than the 200×200 window created by createCanvas().
Expected behavior:
The canvas should fully match the window dimensions specified in createCanvas().
Possible cause:
This might be related to pixel density or scaling on high-DPI displays (e.g., macOS Retina).
Environment:
- Platform: macOS 15.6.1
- Display: Retina (high-DPI)