+ 1
Clarity or Sharpness Issue?
In canvas i have faced a problem that the clarity of the sketch any random color balls or anything i created! https://code.sololearn.com/WagxQo1z0C3e/?ref=app
2 Answers
+ 2
You're setting the width and height in CSS, but not on the actual canvas element
The width by default is 300 and the height by default is 150
So you're CSS code is stretching it out
Add the following under line 11 to fix your problem:
canvas.height = h;
canvas.width = w;
Line 11 is: canvas.style=`height:${h}px;width:${w}px;background:#000`
Let me know if you need help