function tool_circle() { var tool = this; this.started = false; this.mousedown = function (ev) { tool.started = true; tool.x0 = ev._x; tool.y0 = ev._y; }; this.mousemove = function (ev) { if (!tool.started) { return; } context.fillStyle = 'red'; var distance = Math.sqrt(Math.pow(tool.x0 - ev._x, 2) + Math.pow(tool.y0 - ev._y)); context.beginPath(); context.arc(tool.x0, tool.y0,15, 0, Math.PI * 2, false); context.stroke(); context.fill(); }; this.mouseup = function (ev) { if (tool.started) { tool.mousemove(ev); tool.started = false; img_update(); } }; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)