I use the P5.JS library to draw a square wide and full canvas:
function setup() { createCanvas(100,100); background(200,200,200); } function draw() { rect(0, 0, 100, 100); } According to the P5, 100 directory in my rect () method, this is the width and height of the rectangle.
Then why does my square go beyond the canvas and I don’t see its two sides?
If you change to rect(0, 0, 99, 99) then the square takes up the entire outline.
Then it may seem that 99 are the coordinates of the opposite angle,
but it is not, it is precisely the length and width.


box-sizingCSS property, then a square with a side of 100px and a frame with a thickness of 100px will actually not be 100 by 100, but 300 by 300, and if you limit the scope to a hundred pixels, then you’ll will see. - smellyshovel