From d85c7ea4ecc177bbd8a63682686a4013b923bcbc Mon Sep 17 00:00:00 2001 From: Liu Date: Tue, 10 Sep 2024 23:19:53 +0800 Subject: [PATCH] fixup! feat: DPI awareness --- lib/css/src/computed.c | 3 +-- src/lcui_ui.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/css/src/computed.c b/lib/css/src/computed.c index 34524c1a9..61ad328a2 100644 --- a/lib/css/src/computed.c +++ b/lib/css/src/computed.c @@ -1079,8 +1079,7 @@ static void compute_absolute_width(const css_computed_style_t *parent, s->type_bits.width = CSS_WIDTH_FIT_CONTENT; break; } - if (is_css_display_block(parent) && - compute_content_box_fixed_width(parent, &parent_value)) { + if (compute_content_box_fixed_width(parent, &parent_value)) { value = parent_value - s->margin_left - s->margin_right; if (s->type_bits.box_sizing == CSS_BOX_SIZING_CONTENT_BOX) { diff --git a/src/lcui_ui.c b/src/lcui_ui.c index f5dee0bac..043a32db8 100644 --- a/src/lcui_ui.c +++ b/src/lcui_ui.c @@ -253,6 +253,7 @@ void lcui_set_ui_display_mode(lcui_display_mode_t mode) list_append(&lcui_ui.windows, wnd); ui_server_connect(ui_root(), wnd); app_window_set_fullscreen(wnd, true); + ui_metrics.dpi = 1.f * app_window_get_dpi(wnd); break; case LCUI_DISPLAY_MODE_SEAMLESS: options.child_list = true; @@ -270,6 +271,7 @@ void lcui_set_ui_display_mode(lcui_display_mode_t mode) wnd = app_window_create(NULL, 0, 0, 0, 0, NULL); list_append(&lcui_ui.windows, wnd); ui_server_connect(ui_root(), wnd); + ui_metrics.dpi = 1.f * app_window_get_dpi(wnd); break; } lcui_ui.mode = mode;