Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day π
I'm a full-stack developer from South Africa πΏπ¦. I love writing about JavaScript, HTML and CSS.
Markdown supported Β· ββ΅ to post
Great article! Thanks! I've made the "fixed-width" version, by setting the canvas size to copy it's parent wrapper's size.
ctx.canvas.width = canvas.offsetWidth;
ctx.canvas.height = canvas.offsetHeight;
codepen.io/frendhisaido_1470415284/pen/dyXypKB
But I'm still not sure why if the canvas is inside any parent that has a relative position, the mouse draw precision will be off by a few pixels.
Tapas Adhikary
Great article, Chris Bongers!