diff --git a/src/widgets/scale/lv_scale.c b/src/widgets/scale/lv_scale.c index a1c89c5cbd70..3956e58a5174 100644 --- a/src/widgets/scale/lv_scale.c +++ b/src/widgets/scale/lv_scale.c @@ -487,8 +487,13 @@ static void lv_scale_event(const lv_obj_class_t * class_p, lv_event_t * event) scale_find_section_tick_idx(obj); scale_calculate_main_compensation(obj); - scale_draw_indicator(obj, event); - scale_draw_main(obj, event); + if (scale->draw_ticks_on_top) { + scale_draw_main(obj, event); + scale_draw_indicator(obj, event); + } else { + scale_draw_indicator(obj, event); + scale_draw_main(obj, event); + } } } if(event_code == LV_EVENT_DRAW_POST) { @@ -496,8 +501,13 @@ static void lv_scale_event(const lv_obj_class_t * class_p, lv_event_t * event) scale_find_section_tick_idx(obj); scale_calculate_main_compensation(obj); - scale_draw_indicator(obj, event); - scale_draw_main(obj, event); + if (scale->draw_ticks_on_top) { + scale_draw_main(obj, event); + scale_draw_indicator(obj, event); + } else { + scale_draw_indicator(obj, event); + scale_draw_main(obj, event); + } } } else if(event_code == LV_EVENT_REFR_EXT_DRAW_SIZE) {