jimdoescode/jqScribble

stop draw

Closed this issue · 4 comments

how i can set draw line is disabled

Hello,

I'm not really sure what you're asking here. Can you give some more clarification?

my English is not very good,i mean how i can stop draw by which function .when i want draw i can start,when i don't want draw ,i can stop

I'm still not sure what you're asking. If you need alerts for when drawing starts and stops then you should make a brush. That has methods for when drawing starts and stops. I'm going to close this issue since it doesn't seem like there's an actual problem, just a question. Feel free to continue the dialog here though and I'll do my best to assist you.

I think @Leexxttt might want to be able to disable drawing to the canvas.

I needed something where I could disable the drawing and reenable it when the user clicks different buttons. In case anyone else needs to do something like this, you could create a brush with empty strokeBegin()/strokeMove() like this:

NoBrush.prototype = new jqScribbleBrush;
function NoBrush() {
	NoBrush.prototype.strokeBegin = function(x, y) {};
	NoBrush.prototype.strokeMove = function(x, y) {};
}

and then call $('#drawing-board').data('jqScribble').update({brush: NoBrush}); to disabled drawing, and then call $('#drawing-board').data('jqScribble').update({brush: BasicBrush}); to start drawing again