How are you currently snapping the angle to 45 degrees? Are you using angleSnap = round(angle / 45) * 45 or something else?
yes I'm snapping the angle at 45 degree with tolerance.
For diagonal lines, are you checking if both X and Y positions are changing equally to maintain a perfect diagonal?
for diagonal you need to check if grids(x) and grid(y) are equall (1,1).
are you using a single line object stretched and rotated between start and end points, or a tile-based approach for each grid cell?
I'm using 9patch, so that I can use corners round. you can use tiledBackground too.