fix bitmap drawing, align number picker screen to center
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include "scenes.h"
|
||||
|
||||
#include "liquid.h"
|
||||
#include "graphics/drawing.h"
|
||||
#include "scene_number.h"
|
||||
#include "graphics/display_spec.h"
|
||||
|
||||
struct NumberScene {
|
||||
struct Scene base;
|
||||
@@ -40,11 +41,11 @@ static void paint(struct NumberScene *self)
|
||||
struct NumberSceneOpts *opts = self->opts;
|
||||
|
||||
LCD_clearDisplay(0);
|
||||
LCD_setStrEx(opts->label, 1, 1, BLACK, (struct TextStyle) {.size = FONT_BOLD});
|
||||
LCD_setStrEx(opts->label, LCD_WIDTH/2, 1, BLACK, (struct TextStyle) {.size = FONT_BOLD, .align=ALIGN_CENTER});
|
||||
|
||||
char buf[10];
|
||||
snprintf(buf, 10, "%d%s", opts->value, opts->unit);
|
||||
LCD_setStrEx(buf, 1, 9, BLACK, (struct TextStyle) {.size = FONT_DOUBLE});
|
||||
LCD_setStrEx(buf, LCD_WIDTH/2, 14, BLACK, (struct TextStyle) {.size = FONT_DOUBLE, .align=ALIGN_CENTER});
|
||||
}
|
||||
|
||||
static void deinit(struct NumberScene *self)
|
||||
|
||||
Reference in New Issue
Block a user