add font centering, minor fixes

This commit is contained in:
2020-01-12 13:10:11 +01:00
parent 09d2c5760a
commit 4e2992f244
4 changed files with 45 additions and 18 deletions
+5 -4
View File
@@ -2,9 +2,10 @@
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <analog.h>
#include <firehazard.h>
#include "analog.h"
#include "firehazard.h"
#include "graphics/bitmaps.h"
#include "liquid.h"
#include "graphics/drawing.h"
#include "graphics/display_spec.h"
@@ -74,8 +75,8 @@ static void paint(struct MenuScene *self)
char buf[10];
sprintf(buf, "%.0f", analog_read());
// TODO centering
LCD_setStrEx(buf, 0, 0, BLACK, (struct TextStyle) {.size = FONT_DOUBLE});
LCD_setStrEx("°C", 0, 17, BLACK, (struct TextStyle) {.size = FONT_BOLD});
LCD_setStrEx(buf, XLINE/2, 0, BLACK, (struct TextStyle) {.size = FONT_DOUBLE, .align = ALIGN_CENTER});
LCD_setStrEx("°C", XLINE/2, 17, BLACK, (struct TextStyle) {.align = ALIGN_CENTER}); //.size = FONT_BOLD,
if (fire_enabled()) {
strcpy(buf, "RUN");