Skip to content

Commit

Permalink
fix(css): CONVER -> COVER
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Feb 11, 2024
1 parent 4886b93 commit 959ccb0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/css/include/css/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/css/src/properties/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/src/ui_widget_style.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* lib/ui/src/ui_widget_style.c
*
* Copyright (c) 2023-2024, Liu Chao <[email protected]> All rights reserved.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 959ccb0

Please sign in to comment.