From 86c0cf2bb1031333bfa131b23f153f4a39a239cc Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 26 Nov 2021 14:31:20 -0500
Subject: [PATCH] software: Draw a single pixel for a line with the same
start/end point.
Otherwise it would drop it, which seems like a bug to me, as it normally
fills the endpoint on lines.
Reference #2006.
---
src/render/software/SDL_drawline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/render/software/SDL_drawline.c b/src/render/software/SDL_drawline.c
index d48225396e9..5eebdd5a973 100644
--- a/src/render/software/SDL_drawline.c
+++ b/src/render/software/SDL_drawline.c
@@ -193,8 +193,8 @@ SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count,
continue;
}
- /* Draw the end if it was clipped */
- draw_end = (x2 != points[i].x || y2 != points[i].y);
+ /* Draw the end if the whole line is a single point or it was clipped */
+ draw_end = ((x1 == x2) && (y1 == y2)) || (x2 != points[i].x || y2 != points[i].y);
func(dst, x1, y1, x2, y2, color, draw_end);
}