fix(color): VCENTER does not work for Lua drawText function (#5730)

This commit is contained in:
philmoz
2024-12-22 11:02:26 +10:00
committed by GitHub
parent fc841b1876
commit 8e37d4e49a
+4
View File
@@ -181,6 +181,10 @@ static void drawString(lua_State *L, const char * s, LcdFlags flags)
int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2);
// If VCENTER flag is on then Y position is assumed to be center line for text.
if (flags & VCENTERED)
y -= getFontHeight(flags) / 2;
bool invers = flags & INVERS;
if (flags & BLINK)
invers = invers && !BLINK_ON_PHASE;