# HG changeset patch # User Mike Becker # Date 1754063859 -7200 # Node ID e9540bfa5803d72a1506f3da87cbf41f9439aaa0 # Parent a1d70b8018c12fd8d72b138b99bb631ac9dd96e9 make asc_ui_scale_auto() normalized with Full HD as 100% diff -r a1d70b8018c1 -r e9540bfa5803 src/ui.c --- a/src/ui.c Thu Jul 31 22:14:27 2025 +0200 +++ b/src/ui.c Fri Aug 01 17:57:39 2025 +0200 @@ -31,6 +31,8 @@ #include "ascension/context.h" #include "ascension/scene.h" +#include + void asc_ui_add_node(AscSceneNode *node) { asc_scene_add_node(&asc_active_window->ui, node); } @@ -45,14 +47,7 @@ float asc_ui_scale_auto(void) { const asc_vec2u res = asc_window_display_resolution(); - float scale; - if (res.width > 3100) { - scale = 2.0f; - } else if (res.width > 2000) { - scale = 1.5f; - } else { - scale = 1.f; - } + float scale = roundf((float)res.height / 108.f) / 10.f; asc_ui_scale(scale); return scale; }