Skip to content

Commit

Permalink
fix(color): VCENTER does not work for Lua drawText function (#5730)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Dec 22, 2024
1 parent fc841b1 commit 8e37d4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions radio/src/lua/api_colorlcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e37d4e

Please sign in to comment.