I have a canvas inside a div and it fills the whole div. I draw a line on canvas but when I resize browser window, width of the line on the canvas changes, as I increase browser window size its thickness increases and adds some blur to the line. I figured out that problem occurs here; I dont use a fixed size for canvas instead I use %100 for the width and height.
#myCanvas{
margin:0;
padding: 0;
border:0;
width: 100%;
height: 100%;
background-color: white;
} When I used fixed size in pixeel for width and height, it's ok. But I want my canvas to resize without disturbing the drawing inside. You can play around here: http://codepen.io/ertugrulmurat/pen/nxhof
Just try to change the heigth of browser window. Any idea would be appreciated.