In my HTML canvas project, I am currently drawing lines using a 2d-array that represents blocks of 10x10 pixels. I use Bresenham's algorithm to store line-ids in this array so that I can determine which line is selected.
While this method works, I find that it lacks precision. When I overlay a representation of the array on my canvas, I notice that many of the 10x10 blocks are not completely filled even though the line crosses them:
Is there a more accurate solution to ensure that all grid blocks the actual line passes through are captured?