fix pull request #492 - select_do_line of a point

Latent bug:  selection_do_line() for a single point produced
spurious line(s).

I haven't got a test case so am taking this one on faith....

While in there, do some nearby formatting fixups in sp_lev.c.

Fixes #492
This commit is contained in:
PatR
2021-04-18 14:13:57 -07:00
parent 28a77b9ab0
commit 141cafb210
+4 -2
View File
@@ -4613,7 +4613,6 @@ struct selectionvar *ov)
xi = -1; xi = -1;
dx = x1 - x2; dx = x1 - x2;
} }
if (y1 < y2) { if (y1 < y2) {
yi = 1; yi = 1;
dy = y2 - y1; dy = y2 - y1;
@@ -4624,7 +4623,10 @@ struct selectionvar *ov)
selection_setpoint(x1, y1, ov, 1); selection_setpoint(x1, y1, ov, 1);
if (dx > dy) { if (!dx && !dy) {
/* single point - already all done */
;
} else if (dx > dy) {
ai = (dy - dx) * 2; ai = (dy - dx) * 2;
bi = dy * 2; bi = dy * 2;
d0 = bi - dx; d0 = bi - dx;