From 7e0c78e2b723f9ddff6f21dbdd4bc43a7904ca4c Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 7 Mar 2016 18:54:00 +0100 Subject: [PATCH] Lua lcd.drawLine was not OK when (x1=x2 and y1>y2) or (y1=y2 and x1>x2) --- radio/src/lua/api_lcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/lua/api_lcd.cpp b/radio/src/lua/api_lcd.cpp index ef11fd229..862798c6c 100644 --- a/radio/src/lua/api_lcd.cpp +++ b/radio/src/lua/api_lcd.cpp @@ -124,11 +124,11 @@ static int luaLcdDrawLine(lua_State *L) if (pat == SOLID) { if (x1 == x2) { - lcdDrawSolidVerticalLine(x1, y1, y2 >= y1 ? y2-y1+1 : y2-y1-1, flags); + lcdDrawSolidVerticalLine(x1, y2 >= y1 ? y1 : y1+1, y2 >= y1 ? y2-y1+1 : y2-y1-1, flags); return 0; } else if (y1 == y2) { - lcdDrawSolidHorizontalLine(x1, y1, x2 >= x1 ? x2-x1+1 : x2-x1-1, flags); + lcdDrawSolidHorizontalLine(x2 >= x1 ? x1 : x1+1, y1, x2 >= x1 ? x2-x1+1 : x2-x1-1, flags); return 0; } }