Drawing overlapping semi-transparent lines without visible overlap
问题 I'm developing a painter program using HTML5 canvas. I have created a drawing tool where the user drags and moves the mouse. I have a listener on mousemove event that draws short lines: Painter.mainCanvas.beginPath(); Painter.mainCanvas.moveTo(Painter.lastX, Painter.lastY); Painter.lastX = e.offsetX; Painter.lastY = e.offsetY; Painter.mainCanvas.lineTo(Painter.lastX, Painter.lastY); Painter.mainCanvas.stroke(); Everything works well until I set the global Alpha to < 1. When using this method