fix(layout): calculate content width using x alignment (#6948)

This commit is contained in:
Liam
2024-09-30 12:44:25 +02:00
committed by GitHub
parent 2acd6ff7e3
commit a298c245ac

View File

@@ -1046,7 +1046,7 @@ static int32_t calc_content_width(lv_obj_t * obj)
default:
/* Consider other cases only if x=0 and use the width of the object.
* With x!=0 circular dependency could occur. */
if(lv_obj_get_style_y(child, 0) == 0) {
if(lv_obj_get_style_x(child, 0) == 0) {
child_res_tmp = lv_area_get_width(&child->coords) + space_left;
child_res_tmp += lv_obj_get_style_margin_right(child, LV_PART_MAIN);
}