diff --git a/lib/css/include/css/types.h b/lib/css/include/css/types.h index cf99d78f4..4985ca765 100644 --- a/lib/css/include/css/types.h +++ b/lib/css/include/css/types.h @@ -165,7 +165,7 @@ typedef enum { CSS_BACKGROUND_SIZE_INHERIT, CSS_BACKGROUND_SIZE_SET, CSS_BACKGROUND_SIZE_AUTO, - CSS_BACKGROUND_SIZE_CONVER, + CSS_BACKGROUND_SIZE_COVER, CSS_BACKGROUND_SIZE_CONTAIN } css_background_size_t; diff --git a/lib/css/src/properties/background.c b/lib/css/src/properties/background.c index 5b6f8ba55..28165980a 100644 --- a/lib/css/src/properties/background.c +++ b/lib/css/src/properties/background.c @@ -102,7 +102,7 @@ static int css_cascade_background_size_1(const css_style_array_value_t input, break; case CSS_KEYWORD_COVER: s->type_bits.background_width = - CSS_BACKGROUND_SIZE_CONVER; + CSS_BACKGROUND_SIZE_COVER; break; case CSS_KEYWORD_CONTAIN: s->type_bits.background_width = diff --git a/lib/ui/src/ui_widget_style.c b/lib/ui/src/ui_widget_style.c index c4ab7c666..2a859d4ca 100644 --- a/lib/ui/src/ui_widget_style.c +++ b/lib/ui/src/ui_widget_style.c @@ -1,4 +1,4 @@ -/* +/* * lib/ui/src/ui_widget_style.c * * Copyright (c) 2023-2024, Liu Chao All rights reserved. @@ -269,7 +269,7 @@ static void ui_widget_on_image_load(ui_image_t *loaded_image, void *data) CSS_COPY_LENGTH(s, &w->specified_style, background_position_x); CSS_COPY_LENGTH(s, &w->specified_style, background_position_y); switch (s->type_bits.background_width) { - case CSS_BACKGROUND_SIZE_CONVER: + case CSS_BACKGROUND_SIZE_COVER: scale = 1.f * w->padding_box.width / img->width; scale = y_max(scale, 1.f * w->padding_box.height / img->height); CSS_SET_FIXED_LENGTH(s, background_width, scale * img->width);