Properly Resizing your Canvas

The fix for this is pretty straightforward. Don’t use CSS for specifying your canvas’s size. Instead, set the width and height attribute values on your canvas element directly:

Get hands-on with 1200+ tech skills courses.