0

I have fixed myself a canvas which can be painted on + disable selection + detecting cross browser when the mouse is clicked.

Here it is : http://jsfiddle.net/EsYqm/52/

But how can I change the cursor (nevermind to which ) while i'm pressing the left mouse click ( which means - while painting )

(im using chrome 27)

Community
  • 1
  • 1
Royi Namir
  • 144,742
  • 138
  • 468
  • 792

2 Answers2

1

Add this to your CSS...

body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
canvas:active, canvas:focus { 
    cursor: crosshair; 
}
OzrenTkalcecKrznaric
  • 5,535
  • 4
  • 34
  • 57
0

Add

   $('canvas').css( 'cursor', 'text' );

after if (letsdraw === true)

so your condition would be

   if (letsdraw === true)
    {
        $('canvas').css( 'cursor', 'text' );
        ctx.lineTo(e.pageX - canvasOffset.left, e.pageY - canvasOffset.top);
        ctx.stroke();
    }
Dolly
  • 1,042
  • 4
  • 27
  • 47