Skip to content

Commit

Permalink
sdk: fix menu title font descent getting trimmed
Browse files Browse the repository at this point in the history
  • Loading branch information
and3rson committed Apr 22, 2024
1 parent e4b05bc commit ef5c348
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/lib/lilka/src/lilka/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void Menu::draw(Arduino_GFX* canvas) {
const uint16_t titleWidthAvailable = canvas->width() - 64;
if (titleWidth > titleWidthAvailable) {
// Marquee
Canvas marquee(titleWidthAvailable, titleTextHeight);
Canvas marquee(titleWidthAvailable, titleTextHeight + 8);
marquee.fillScreen(lilka::colors::Black);
marquee.setFont(FONT_6x13);
marquee.setTextSize(2);
Expand All @@ -156,15 +156,15 @@ void Menu::draw(Arduino_GFX* canvas) {
marquee.setTextColor(lilka::colors::White);
marquee.println(title);
canvas->draw16bitRGBBitmapWithTranColor(
32, 0, marquee.getFramebuffer(), lilka::colors::Black, titleWidthAvailable, titleTextHeight
32, 0, marquee.getFramebuffer(), lilka::colors::Black, marquee.width(), marquee.height()
);
} else {
// Text fits
canvas->setFont(FONT_6x13);
canvas->setTextSize(2);
canvas->setCursor(32, 40);
canvas->setTextColor(lilka::colors::White);
canvas->setTextBound(32, 8, titleWidthAvailable, 32);
canvas->setTextBound(32, 8, titleWidthAvailable, titleTextHeight);
canvas->println(title);
}

Expand Down

0 comments on commit ef5c348

Please sign in to comment.