//Set the draw Function function DrawCanvas(xpos, ypos, PressedDown,PressedShift) { var cwidth = document.getElementById('canvasWidth').value; var ccolour = document.getElementById('canvasColour').value; //Check if Mouse is Pressed Down if (PressedDown) { //Start drawing a new path canvascontext.beginPath(); //Set Stroke Style canvascontext.strokeStyle = ccolour; //Set Line Tickness canvascontext.lineWidth = cwidth; //Set the Linse Style to Default Round canvascontext.lineJoin = "round"; //Go to the Current Point of the Cursor canvascontext.moveTo(currentXpos, currentYpos); //Draw Straight Line From Current Position canvascontext.lineTo(xpos, ypos); if(PressedShift) { canvascontext.beginPath(); canvascontext.fillStyle="#e4e8e3"; canvascontext.arc(currentXpos, currentYpos,50,0,currentYpos, false); //End the Current Path canvascontext.fill(); } canvascontext.closePath(); //Make the Drawing Visible canvascontext.stroke(); } //Set X and Y Positions to Current X and Y Positions currentXpos = xpos; currentYpos = ypos; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)