Fix Canvas Size in Processing.js

Finally the shape of the circle inside the canvas looks correct.

Size of the canvas should stated inside setup() function in JavaScript and not Cascading Style Sheets. We guess, if we did not mention the size of the canvas inside the setup() function, the default size, width is 200px and height is 200px, will be set. When it comes to Cascading Style Sheets after finish running the setup() JavaScript function, it tend to stretch to the size that mention in Cascading Style Sheets.

Gallery

Comments

Comments powered by Disqus