In many drawing tools (Adobe Photoshop, Sketch, and so on), if we hold the SHIFT button when drawing a line, we can create perfectly straight lines horizontally or vertically. Recently, I tried implementing this feature in canvas by JavaScript. The process is really interesting. …