pixelkind / p5canvas

An interactive preview for writing p5js code in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=garrit.p5canvas
Other
39 stars 4 forks source link

width and height return values unrelated to canvas call #73

Open azalea666 opened 1 month ago

azalea666 commented 1 month ago

the width and height global variables from P5JS return values unrelated to the canvas call. they vary depending on the size of the window tab but they should give the dimensions of the canvas.

function setup() {
  createCanvas(400, 400);
  print(width + "," + height);
}

function draw() {
  background(220);
}

performs correctly in the Web Editor, but not in the extension.

this explains the bug report #71.