Finished moving color table and added INVERS

This commit is contained in:
Raphael Coeffic
2021-05-06 12:55:59 +02:00
committed by Raphael Coeffic
parent 897d8535e7
commit 9bcd15e49d
3 changed files with 10 additions and 7 deletions
+1
View File
@@ -11,6 +11,7 @@ file(GLOB WIDGETS_SRC RELATIVE ${RADIO_SRC_DIR}/gui/colorlcd ${RADIO_SRC_DIR}/gu
set(GUI_SRC
${GUI_SRC}
colors.cpp
lcd.cpp
splash.cpp
fonts.cpp
+1
View File
@@ -20,4 +20,5 @@
#include "colors.h"
uint16_t lcdColorTable[LCD_COLOR_COUNT];
+8 -7
View File
@@ -203,7 +203,7 @@ static int luaLcdDrawText(lua_State *L)
const char * s = luaL_checkstring(L, 3);
unsigned int att = luaL_optunsigned(L, 4, 0);
bool invers = att & INVERS;
bool invers = (att & INVERS) && !();
bool blink = att & INVERS;
bool shadowed = att & SHADOWED;
@@ -217,14 +217,15 @@ static int luaLcdDrawText(lua_State *L)
if (invers) {
int height = getFontHeight(att & 0xFFFF);
luaLcdBuffer->drawSolidFilledRect(x - INVERT_BOX_MARGIN,
y - INVERT_BOX_MARGIN,
end_pos - x + 2 * INVERT_BOX_MARGIN,
height + 2 * INVERT_BOX_MARGIN,
);
int width = getTextWidth(s, 255, att);
luaLcdBuffer->drawSolidFilledRect(
x - INVERT_BOX_MARGIN, y - INVERT_BOX_MARGIN,
width + 2 * INVERT_BOX_MARGIN, height + 2 * INVERT_BOX_MARGIN,
FOCUS_BGCOLOR);
att = (att & 0xFFFF) | FOCUS_COLOR;
}
coord_t end_pos = luaLcdBuffer->drawText(x, y, s, att);
luaLcdBuffer->drawText(x, y, s, att);
return 0;
}