This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Draw an arrowhead on a line on an HTML5 canvas. | |
* | |
* Based almost entirely off of http://stackoverflow.com/a/36805543/281460 with some modifications | |
* for readability and ease of use. | |
* | |
* @param context The drawing context on which to put the arrowhead. | |
* @param from A point, specified as an object with 'x' and 'y' properties, where the arrow starts | |
* (not the arrowhead, the arrow itself). | |
* @param to A point, specified as an object with 'x' and 'y' properties, where the arrow ends |