From fc2a7ce42f255fac6d03827f9b0b80bd357eac4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Z=C3=ADpek?= Date: Sun, 30 Jun 2024 10:21:28 +0200 Subject: [PATCH] Improve text alignment --- dow.code-workspace | 9 ++++++++- firmware/dow.cpp | 27 +++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/dow.code-workspace b/dow.code-workspace index 5161195..6ffbb6d 100644 --- a/dow.code-workspace +++ b/dow.code-workspace @@ -7,5 +7,12 @@ "path": "firmware" } ], - "settings": {} + "settings": { + "files.associations": { + "*.ejs": "html", + ".env": "env", + ".env.*": "env", + "cmath": "cpp" + } + } } \ No newline at end of file diff --git a/firmware/dow.cpp b/firmware/dow.cpp index dd33c61..8c4fa89 100644 --- a/firmware/dow.cpp +++ b/firmware/dow.cpp @@ -26,6 +26,8 @@ void dow_get_text_item_rect(GxEPD2_BWfont); display.getTextBounds(item->contents, 0, 0, &tbx, &tby, &tbw, &tbh); + // bool debug = item->contents.equals("Srazky"); + int x = item->x; int y = item->y; int w = tbw; @@ -50,14 +52,14 @@ void dow_get_text_item_rect(GxEPD2_BW &display, dow_item_t *item, int *rx, int *ry, int *rw, int *rh)