Skip to content

Commit

Permalink
feat(scale): Check draw order when drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
C47D committed Jun 4, 2024
1 parent d182379 commit 3a97451
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/widgets/scale/lv_scale.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,17 +487,27 @@ 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) {
if(scale->post_draw == true) {
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) {
Expand Down

0 comments on commit 3a97451

Please sign in to comment.