From 110f16e1df458a67825557886eab8bcfe404a0ae Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 3 Apr 2020 13:31:11 +0200 Subject: [PATCH] minor fixes --- src/lv_widgets/lv_btnmatrix.c | 3 +-- src/lv_widgets/lv_slider.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index 70f69e3e5..ef2570b28 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -165,7 +165,6 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[]) lv_style_int_t bottom = lv_obj_get_style_pad_bottom(btnm, LV_BTNMATRIX_PART_BG); lv_style_int_t inner = lv_obj_get_style_pad_inner(btnm, LV_BTNMATRIX_PART_BG); - lv_coord_t max_w = lv_obj_get_width(btnm) - left - right; lv_coord_t max_h = lv_obj_get_height(btnm) - top - bottom; lv_coord_t act_y = top; @@ -234,7 +233,7 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[]) /* Set the button's area. * If inner padding is zero then use the prev. button x2 as x1 to avoid rounding * errors*/ - if(btn_i != 0 && inner == 0 && ((act_x == left && base_dir != LV_BIDI_DIR_RTL) || + if(btn_i != 0 && inner == 0 && ((act_x != left && base_dir != LV_BIDI_DIR_RTL) || (act_x + act_unit_w == max_w - right && base_dir == LV_BIDI_DIR_RTL))) { lv_area_set(&ext->button_areas[btn_i], ext->button_areas[btn_i - 1].x2, act_y, act_x + act_unit_w, act_y + btn_h); diff --git a/src/lv_widgets/lv_slider.c b/src/lv_widgets/lv_slider.c index 8f07cca02..a83e78e69 100644 --- a/src/lv_widgets/lv_slider.c +++ b/src/lv_widgets/lv_slider.c @@ -102,6 +102,8 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy) lv_style_list_copy(&ext->style_knob, ©_ext->style_knob); lv_area_copy(&ext->left_knob_area, ©_ext->left_knob_area); lv_area_copy(&ext->right_knob_area, ©_ext->right_knob_area); + + lv_obj_refresh_style(slider, LV_OBJ_PART_ALL); } LV_LOG_INFO("slider created");