// Keep track of the mouse button being pressed and draw a dot at current location
function sketchpad_mouseDown() {
mouseDown=1;
- drawDot(ctx,mouseX,mouseY,12);
+ drawDot(ctx,mouseX,mouseY,1);
}
// Keep track of the mouse button being released
// Draw a dot if the mouse button is currently being pressed
if (mouseDown==1) {
- drawDot(ctx,mouseX,mouseY,12);
+ drawDot(ctx,mouseX,mouseY,1);
}
}
// Update the touch co-ordinates
getTouchPos();
- drawDot(ctx,touchX,touchY,12);
+ drawDot(ctx,touchX,touchY,1);
// Prevents an additional mousedown event being triggered
event.preventDefault();
getTouchPos(e);
// During a touchmove event, unlike a mousemove event, we don't need to check if the touch is engaged, since there will always be contact with the screen by definition.
- drawDot(ctx,touchX,touchY,12);
+ drawDot(ctx,touchX,touchY,1);
// Prevent a scrolling action as a result of this touchmove triggering.
event.preventDefault();