lundi 20 avril 2015

How to make a HTML5 canvas paint application responsive using bootstrap?

What are corrections in the code to make it responsive and to make circle and rectangle appear on screen where ever user clicks.

<script>
   function mouseDown(e) {
     var a= e.pageX - this.offsetLeft;
     var b= e.pageY - this.offsetTop;
   }

   function c1()
   {
    ctx.arc(currX,currY,41,0, 2*Math.PI);
    ctx.stroke();
   }
   function r1(e)
   {
    var a= e.pageX - this.offsetLeft;
    var b= e.pageY - this.offsetTop;
    ctx.rect(a,b,Math.abs(prevX - currX), Math.abs(prevY - currY)); 
    ctx.stroke();
   }
</script>

Aucun commentaire:

Enregistrer un commentaire