layout bugfix

fixes issue #74
This commit is contained in:
Nic Limper
2023-06-27 14:14:52 +02:00
parent a251ed10e7
commit 5376f2540e
2 changed files with 12 additions and 4 deletions

View File

@@ -31,7 +31,7 @@
},
"4": {
"0": {
"location": [ 10, 130, 2 ],
"location": [ 10, 145, "t0_14b_tf" ],
"wind": [ 140, 10, "fonts/bahnschrift30" ],
"temp": [ 10, 10, "fonts/bahnschrift30" ],
"icon": [ 33, 33, "fonts/weathericons78" ],
@@ -57,7 +57,7 @@
},
"8": {
"1": {
"location": [ 5, 0, 2 ],
"location": [ 5, 12, "t0_14b_tf" ],
"column": [ 5, 59 ],
"day": [ 30, 18, "fonts/twcondensed20", 41, 108 ],
"icon": [ 12, 58, "fonts/weathericons30" ],
@@ -90,7 +90,7 @@
},
"10": {
"0": {
"title": [ 10, 3, 2 ],
"title": [ 10, 15, "t0_14b_tf" ],
"pos": [ 76, 20 ]
},
"1": {

View File

@@ -320,8 +320,16 @@ void drawString(TFT_eSprite &spr, String content, uint16_t posx, uint16_t posy,
if (font == "2") {
spr.setTextFont(2);
spr.setTextColor(PAL_BLACK, PAL_WHITE);
spr.setTextColor(color, PAL_WHITE);
spr.drawString(content, posx, posy);
} else if (font != "" && !font.startsWith("fonts/")) {
U8g2_for_TFT_eSPI u8f;
u8f.begin(spr);
setU8G2Font(font, u8f);
u8f.setForegroundColor(color);
u8f.setBackgroundColor(PAL_WHITE);
u8f.setCursor(posx, posy);
u8f.print(content);
} else {
if (font != "") spr.loadFont(font, *contentFS);
spr.setTextColor(color, PAL_WHITE);