Draw bar without LV_DRAW_COMPLEX?

Can’t make that work, I just get a blue rectangle for the whole size with no “bar”. Bar is not meant to work without complex draw or is it possible to get it in some primitive way?

bar = lv_bar_create(lv_scr_act());
    lv_obj_align(bar, LV_ALIGN_TOP_MID, 0, 32);
    lv_obj_set_size(bar, 175, 64);
    lv_bar_set_range(bar, 0, 128);
    lv_bar_set_value(bar, 70, LV_ANIM_OFF);
1 Like

Hi @Rick_Sanchez, I have the same problem like you.
Draw Bar widget does not work without complex draw (LV_DRAW_COPLEX = 0).
This is because the “static void draw_indic (lv_event_t * e)” function uses masks - which do not work without a complex draw engine.
Have you found a solution and would like to share it? :slight_smile:

Edit:
I digged a little bit into the indicator drawing code and I have worked out a workaround.
Get rid of the mask and pass the pointer to &bar->indic_area instead.

static void draw_indic(lv_event_t * e){

lv_draw_rect(draw_ctx, &draw_rect_dsc, &bar->indic_area);

}
Regards :slight_smile: