From 7ac973b4b867a2125a346602908d02d0e588dd97 Mon Sep 17 00:00:00 2001 From: Bigfoot71 Date: Tue, 17 Mar 2026 01:23:22 +0100 Subject: [PATCH] fix pixel origin in line rasterization my bad, an oversight in my previous fix. This offset should have been moved here rather than per pixel during truncation. --- src/external/rlsw.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index 950698f2f..36abcff68 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -5749,10 +5749,11 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b, static void SW_RASTER_LINE(const sw_vertex_t *v0, const sw_vertex_t *v1) { - float x0 = v0->screen[0]; - float y0 = v0->screen[1]; - float x1 = v1->screen[0]; - float y1 = v1->screen[1]; + // Convert from pixel-center convention (n+0.5) to pixel-origin convention (n) + float x0 = v0->screen[0] - 0.5f; + float y0 = v0->screen[1] - 0.5f; + float x1 = v1->screen[0] - 0.5f; + float y1 = v1->screen[1] - 0.5f; float dx = x1 - x0; float dy = y1 - y0;