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

Projectkk2glider/issue 4449 drawline (#4464)

* Gtest pattern changed

* Fixes #4449: lcdDrawLine_line() was wrong for slanted lines [128x64]

* Fixes #4449: lcdDrawLine_line() was wrong for slanted lines [480x272]

* lcdDrawLine() coordinates check moved to Lua API
This commit is contained in:
Damjan Adamic 2017-02-16 00:23:42 +01:00 committed by Bertrand Songis
parent 53f55f8e1d
commit ee43d3fb97
7 changed files with 53 additions and 42 deletions

View file

@ -106,6 +106,9 @@ static int luaLcdDrawLine(lua_State *L)
int pat = luaL_checkinteger(L, 5);
int flags = luaL_checkinteger(L, 6);
if (x1 < 0 || x1 >= LCD_W || y1 < 0 || y1 >= LCD_H || x2 < 0 || x2 >= LCD_W || y2 < 0 || y2 >= LCD_H)
return 0;
if (pat == SOLID) {
if (x1 == x2) {
lcdDrawSolidVerticalLine(x1, y2 >= y1 ? y1 : y1+1, y2 >= y1 ? y2-y1+1 : y2-y1-1, flags);