title: HTML5 Canvas: globalCompositeOperation (eraser)
body: <p><em>How can I use globalCompositeOperation for erasing something?</em></p>
  
  <p><a href="http://canvaspaint.org/" rel="nofollow noreferrer">http://canvaspaint.org/</a> has an eraser, but that's just a white line - ok only if your background is white... </p>
  
  <p>I know you can use ctx.clearRect(). But it didn't really worked for me because while dragging a mouse with eraser (set to 8x8px) it only makes unconnected 8x8px squares - not really a smooth line.</p>
  
  <p>Is there a way how to use globalCompositeOperation as an eraser?</p>
  
  <p>Something like: </p>
  
  <pre><code>ctx.globalCompositeOperation = "___something___";
  ctx.beginPath();
  ctx.lineTo(mouseX , mouseY);
  ctx.closePath();
  </code></pre>
  
  <p>Thank you. </p>