title: HTML canvas - drawing disappear on resizing
body: <p>I have created a basic shape in HTML canvas element which works fine. </p>
  
  <p>The problem occurs when I resize the canvas, all the drawing in the canvas disappears. Is this the normal behavior? or is there a function that can be used to stop this? </p>
  
  <p>One way to fix this could be to call drawing function again on canvas resize however this may not be very efficient if there is huge content to be drawn.</p>
  
  <p>What's the best way?</p>
  
  <p>Here is the link to sample code <a href="https://gist.github.com/2983915" rel="noreferrer">https://gist.github.com/2983915</a></p>