Event sent wrong in lv_meter.c?

Hi,I found a strange thing in lv_meter.c that is not sending LV_EVENT_DRAW_PART_END after sending event LV_EVENT_DRAW_PART_BEGIN but LV_EVENT_DRAW_MAIN_END.Is any order wrong here?

@kisvegabor

And other following codes are should be considered as lacked or mistaken:

  1. In static function draw_arcs,variable part_draw_dsc indicates its part is LV_PART_INDICATOR,BUT,docs indicate it should be LV_PART_ITEMS.
  2. In static function draw_needles,variable same called part_draw_dsc lacks its part,and it should be LV_PART_INDICATOR.
    What I mentioned above influences my callback for events.Such as:
void test_meter1_draw_part_begin_cb(lv_event_t *e)
{
    lv_obj_t *meter = lv_event_get_current_target(e);
    lv_obj_draw_part_dsc_t *dsc = lv_event_get_draw_part_dsc(e);

    // Part is lacked,so it will not go into this condition
    if(dsc->part == LV_PART_INDICATOR)
    {
        if(dsc->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE)
        {
            dsc->line_dsc->color = lv_color_mix(lv_palette_main(LV_PALETTE_RED),lv_palette_main(LV_PALETTE_BLUE),127);
            dsc->line_dsc->opa = LV_OPA_60;
        }
    }
}

Hi,

You are right and I’ve pushed a fix.

However according to the docs and the code in draw_needles part should be LV_PART_ITEMS.

Yes,it should be LV_PART_ITEMS.I read docs too fast. :joy:
And I want to ask,is it really ok with + +? See picture under.

It’s not ok, I’ve fixed it too :slight_smile: