When using lv_style_set_transform_width/height
in conjunction with a transition animation the time is not honoured for the pressed state.
Tested on simulator with a simple button, changing its width and height when pressed.
7.5.0-dev sync 14th Sept 20
What do you experience?
The button pressed transition occurs immediately (ignoring transition time) but the reverse (released button) transitions correctly. Note: the transform is correct, just the time it takes is off.
What do you expect?
Pressing the button should transform the width/height of the button to the new value over the specified time period.
Code to reproduce
static lv_style_t buttonStyle;
static const lv_style_int_t BUTTON_TRANSITION_TIME = 2000;
static const lv_style_int_t BUTTON_SIZE_OFFSET_ANIM = 10;
lv_obj_t* create_func( lv_obj_t* parent )
{
lv_style_init( &buttonStyle );
lv_style_set_transform_width( &buttonStyle, LV_STATE_PRESSED, BUTTON_SIZE_OFFSET_ANIM );
lv_style_set_transform_height( &buttonStyle, LV_STATE_PRESSED, BUTTON_SIZE_OFFSET_ANIM );
lv_style_set_transition_time( &buttonStyle, LV_STATE_PRESSED, BUTTON_TRANSITION_TIME );
lv_style_set_transition_time( &buttonStyle, LV_STATE_DEFAULT, BUTTON_TRANSITION_TIME );
lv_style_set_transition_prop_1( &buttonStyle, LV_STATE_PRESSED, LV_STYLE_TRANSFORM_WIDTH );
lv_style_set_transition_prop_2( &buttonStyle, LV_STATE_PRESSED, LV_STYLE_TRANSFORM_HEIGHT );
lv_style_set_transition_prop_3( &buttonStyle, LV_STATE_DEFAULT, LV_STYLE_TRANSFORM_WIDTH );
lv_style_set_transition_prop_4( &buttonStyle, LV_STATE_DEFAULT, LV_STYLE_TRANSFORM_HEIGHT );
lv_obj_t* testButton = lv_btn_create( gauge, NULL );
lv_obj_reset_style_list( testButton, LV_CONT_PART_MAIN );
lv_obj_add_style( testButton, LV_BTN_PART_MAIN, &buttonStyle );