From 83ab7e731dbd7f430b82420641ab892044e03b6c Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sun, 7 Aug 2022 14:49:21 +0100 Subject: [PATCH] limit logo to 25mm, move text to lower --- src/pbsplash.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pbsplash.c b/src/pbsplash.c index ae31742..02b2539 100644 --- a/src/pbsplash.c +++ b/src/pbsplash.c @@ -21,7 +21,7 @@ #define MSG_MAX_LEN 4096 #define DEFAULT_FONT_PATH "/usr/share/pbsplash/OpenSans-Regular.svg" -#define LOGO_SIZE_MAX_MM 50 +#define LOGO_SIZE_MAX_MM 25 #define FONT_SIZE_PT 9 #define FONT_SIZE_B_PT 5 #define PT_TO_MM 0.38f @@ -372,7 +372,7 @@ int main(int argc, char **argv) // Center the image x -= image_w * 0.5f; y -= image_h * 0.5f; - float animation_y = y + image_h + MM_TO_PX(dpi, 8); + float animation_y = y + image_h + MM_TO_PX(dpi, 5); tfb_clear_screen(tfb_make_color(background_color.r, background_color.g, background_color.b)); @@ -413,7 +413,7 @@ int main(int argc, char **argv) &textHeight); tx = screenWidth / 2.f - textWidth / 2.f; - ty = animation_y + ((screenHeight - bottomTextHeight) - animation_y) / 3.f; + ty = screenHeight - bottomTextHeight - MM_TO_PX(dpi, font_size_b * PT_TO_MM * 2) - textHeight; draw_text(font, message, tx, ty, textWidth, textHeight, fontsz, tfb_gray); @@ -427,13 +427,12 @@ int main(int argc, char **argv) int frame = 0; int tty = open(active_tty, O_RDWR); - float y_off = y + image_h + MM_TO_PX(dpi, 5); while (!terminate) { if (!animation) { sleep(1); continue; } - animate_frame(frame++, screenWidth, y_off, dpi); + animate_frame(frame++, screenWidth, animation_y, dpi); tfb_flush_fb(); }