From 95a30390e33e185ab3c97093e8b549f49781716f Mon Sep 17 00:00:00 2001 From: Jason Perlow Date: Sun, 11 Oct 2026 11:26:47 -0400 Subject: [PATCH] fix(splash): fit the logo to the surface and scale the bar The logo was sized from the surface height alone, so a wide wordmark came out about 2.1x the screen height wide and was cropped on every landscape panel, and the loading bar was a fixed 220x4 px. Fit the logo inside 60% of the width and 16% of the height and grow the bar with the height. Assisted-by: DeepSeek:deepseek-flash AI-Scope: fitted the splash logo to the surface box and scaled the loading bar in render.c. --- src/render.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/render.c b/src/render.c index b633548..d7da028 100644 --- a/src/render.c +++ b/src/render.c @@ -159,11 +159,19 @@ void loginui_render_splash(cairo_t *cr, int width, int height, double cx = w / 2.0; + double unit = h / 1080.0; + if (unit < 1.0) unit = 1.0; + if (unit > 4.0) unit = 4.0; + if (logo) { int lw = cairo_image_surface_get_width(logo); int lh = cairo_image_surface_get_height(logo); - double target = h * 0.16; - double scale = lh > 0 ? target / lh : 1.0; + double scale = 1.0; + if (lw > 0 && lh > 0) { + double sh = (h * 0.16) / lh; + double sw = (w * 0.60) / lw; + scale = sh < sw ? sh : sw; + } double dw = lw * scale, dh = lh * scale; cairo_save(cr); cairo_translate(cr, cx - dw / 2.0, h * 0.46 - dh / 2.0); @@ -173,7 +181,8 @@ void loginui_render_splash(cairo_t *cr, int width, int height, cairo_restore(cr); } - double track_w = 220, track_h = 4; + double track_w = 220 * unit, track_h = 4 * unit; + if (track_w > w * 0.60) track_w = w * 0.60; double track_x = cx - track_w / 2.0; double track_y = h * 0.62; double r = track_h / 2.0;