I have 2 buttons with respective functions: linemaker
and circlemaker
.
In linemaker
I have 3 eventlisteners
: mousedown
, mousemove
, and mouseup
. This is so I can draw on the canvas.
In circlemaker
I have 1 eventlistener
: click
. So I take a radius input from the user and with a click, they can make circles on the canvas.
But if they click both buttons, after they draw, there will be a circle at the end of the line. I want to stop this from happening, so if they click the circle button, the line button's function will stop. And vice versa.
Is there a way to do this? I don't use any setTimeout
so I don't think I can use clearTimeout
here.