Can someone explain what’s happening here. I create an image, size v,v. I draw a white dot at v,v. I create a rectangle at 1,1 with width v, and height v. I draw a diagonal line from 1,1 to v,v. Everything seems to work OK until the value of v is greater than 495. Over 495, it doesn’t draw the rectangle or the diagonal line to the dot at v,v. Run the program with the value of v at 300, 400, 500, and 600.
function setup()
displayMode(FULLSCREEN)
v=300 -- change to 400, 500, 600
c=color(255,255,255)
img = image(v,v)
img:set(v,v,c) -- draw white dot at v,v
setContext(img)
fill(175, 179, 75, 255)
rect(1,1,v,v) -- draw rect at 1,1 width v, height v
stroke(251, 0, 0, 255)
strokeWidth(3)
line(1,1,v,v) -- draw diagonal line from 1,1 to v,v
end
function draw()
background(0,0,0)
sprite(img,WIDTH/2,HEIGHT/2) -- draw image centered on screen
end