/* Get the transition style of an object for a given part and for a given state. If the transition style for the part-state pair doesn't exist allocate and return it.  */
static _lv_obj_style_t* get_trans_style(lv_obj_t *obj, lv_style_selector_t selector)
/* Get the transition style of an object for a given part and for a given state. If the transition style for the part-state pair doesn't exist allocate and return it.  */
static _lv_obj_style_t* get_trans_style(lv_obj_t *obj, lv_style_selector_t selector)
{
    uint32_t i;
    for(i = 0; i < obj->style_cnt; i++) {
        if(obj->styles[i].is_trans && obj->styles[i].selector == selector) break;
    }
    if(i != obj->style_cnt) return &obj->styles[i];
    obj->style_cnt++;
    obj->styles = lv_mem_realloc(obj->styles, obj->style_cnt * sizeof(_lv_obj_style_t));
    for(i = obj->style_cnt - 1; i > 0 ; i--) {
        obj->styles[i] = obj->styles[i - 1];
    }
    lv_memset_00(&obj->styles[0], sizeof(_lv_obj_style_t));
    obj->styles[0].style = lv_mem_alloc(sizeof(lv_style_t));
    lv_style_init(obj->styles[0].style);
    obj->styles[0].is_trans = 1;
    obj->styles[0].selector = selector;
    return &obj->styles[0];
}