FS#13970 - lcd_drawline() different depending on drawing direction

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 20c763ff891b145f438aad8febeb324ce7a67965
Author: William Wilgus <[email protected]>
Date:   Wed Aug 5 09:19:26 2026 -0400

    FS#13970 - lcd_drawline() different depending on drawing direction
    
    swap x1/x2 and y1/y2 rather than negating the increment
    
    Change-Id: I16c37ab00c2a9a7f97768da68508c2d5c98a14c5

diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 68299df246..c4009155fa 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -925,14 +925,18 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2)
 
     if (x1 > x2)
     {
-        xinc1 = -xinc1;
-        xinc2 = -xinc2;
+        /* swap their identities */
+        int x0 = x2;
+        x2 = x1;
+        x1 = x0;
     }
 
     if (y1 > y2)
     {
-        yinc1 = -yinc1;
-        yinc2 = -yinc2;
+        /* swap their identities */
+        int y0 = y2;
+        y2 = y1;
+        y1 = y0;
     }
 
     x = x1;
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.