Skip to content

Commit

Permalink
fixup! feat: DPI awareness
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Sep 10, 2024
1 parent 4c4cd71 commit d85c7ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/css/src/computed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/lcui_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit d85c7ea

Please sign in to comment.