Finished moving color table and added INVERS
This commit is contained in:
committed by
Raphael Coeffic
parent
897d8535e7
commit
9bcd15e49d
@@ -11,6 +11,7 @@ file(GLOB WIDGETS_SRC RELATIVE ${RADIO_SRC_DIR}/gui/colorlcd ${RADIO_SRC_DIR}/gu
|
|||||||
|
|
||||||
set(GUI_SRC
|
set(GUI_SRC
|
||||||
${GUI_SRC}
|
${GUI_SRC}
|
||||||
|
colors.cpp
|
||||||
lcd.cpp
|
lcd.cpp
|
||||||
splash.cpp
|
splash.cpp
|
||||||
fonts.cpp
|
fonts.cpp
|
||||||
|
|||||||
@@ -20,4 +20,5 @@
|
|||||||
|
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
|
|
||||||
|
uint16_t lcdColorTable[LCD_COLOR_COUNT];
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ static int luaLcdDrawText(lua_State *L)
|
|||||||
const char * s = luaL_checkstring(L, 3);
|
const char * s = luaL_checkstring(L, 3);
|
||||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||||
|
|
||||||
bool invers = att & INVERS;
|
bool invers = (att & INVERS) && !();
|
||||||
bool blink = att & INVERS;
|
bool blink = att & INVERS;
|
||||||
bool shadowed = att & SHADOWED;
|
bool shadowed = att & SHADOWED;
|
||||||
|
|
||||||
@@ -217,14 +217,15 @@ static int luaLcdDrawText(lua_State *L)
|
|||||||
|
|
||||||
if (invers) {
|
if (invers) {
|
||||||
int height = getFontHeight(att & 0xFFFF);
|
int height = getFontHeight(att & 0xFFFF);
|
||||||
luaLcdBuffer->drawSolidFilledRect(x - INVERT_BOX_MARGIN,
|
int width = getTextWidth(s, 255, att);
|
||||||
y - INVERT_BOX_MARGIN,
|
luaLcdBuffer->drawSolidFilledRect(
|
||||||
end_pos - x + 2 * INVERT_BOX_MARGIN,
|
x - INVERT_BOX_MARGIN, y - INVERT_BOX_MARGIN,
|
||||||
height + 2 * 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user