Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Switch.prototype.draw = function() {
- var theta = Math.atan2(offset.y, offset.x);
- var len = this.length();
- ctx.save();
- ctx.translate(this.start.x, this.start.y);
- ctx.rotate(theta);
- ctx.beginPath();
- ctx.moveTo(0, 0);
- ctx.lineTo(len / 2 - 16, 0);
- ctx.moveTo(len / 2 + 32, 0);
- ctx.lineTo(len, 0);
- ctx.moveTo(len / 2 - 12, 0);
- ctx.arc(len / 2 - 12, 0, 10, Math.PI * 2, false);
- //ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement