1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

LUA horizontal and vertical lcd.drawLine(...) fix

Fixes #4608
This commit is contained in:
Florent Martel 2017-03-16 20:16:43 -05:00
parent b18ae12e08
commit 47f029f01c

View file

@ -119,11 +119,11 @@ static int luaLcdDrawLine(lua_State *L)
if (pat == SOLID) { if (pat == SOLID) {
if (x1 == x2) { if (x1 == x2) {
lcdDrawSolidVerticalLine(x1, y1<y2 ? y1 : y2, y1<y2 ? y2-y1 : y1 - y2, flags); lcdDrawSolidVerticalLine(x1, y1<y2 ? y1 : y2, y1<y2 ? (y2-y1)+1 : (y1-y2)+1, flags);
return 0; return 0;
} }
else if (y1 == y2) { else if (y1 == y2) {
lcdDrawSolidHorizontalLine(x1<x2 ? x1:x2, y1, x1<x2 ? x2-x1 : x1-x2, flags); lcdDrawSolidHorizontalLine(x1<x2 ? x1 : x2, y1, x1<x2 ? (x2-x1)+1 : (x1-x2)+1, flags);
return 0; return 0;
} }
} }