BigW Consortium Gitlab

Commit bf8cf9fb by Gabor Kiss-Vamosi

lv_label: scroll anim position bugifx

parent a7a6812a
...@@ -132,20 +132,23 @@ bool lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param) ...@@ -132,20 +132,23 @@ bool lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param)
* make the object specific signal handling */ * make the object specific signal handling */
if(valid != false) { if(valid != false) {
lv_label_ext_t * ext = lv_obj_get_ext(label); lv_label_ext_t * ext = lv_obj_get_ext(label);
/*No signal handling*/ if(sign == LV_SIGNAL_CLEANUP) {
switch(sign) {
case LV_SIGNAL_CLEANUP:
if(ext->static_txt == 0) { if(ext->static_txt == 0) {
dm_free(ext->txt); dm_free(ext->txt);
ext->txt = NULL; ext->txt = NULL;
} }
break;
case LV_SIGNAL_STYLE_CHG:
lv_label_set_text(label, NULL);
break;
default:
break;
} }
else if(sign == LV_SIGNAL_STYLE_CHG) {
lv_label_refr_text(label);
}
else if (sign == LV_SIGNAL_CORD_CHG) {
if(area_get_width(&label->cords) != area_get_width(param)
|| area_get_height(&label->cords) != area_get_height(param))
{
lv_label_refr_text(label);
}
}
} }
return valid; return valid;
...@@ -624,7 +627,7 @@ static void lv_label_refr_text(lv_obj_t * label) ...@@ -624,7 +627,7 @@ static void lv_label_refr_text(lv_obj_t * label)
if(lv_obj_get_height(label) > lv_obj_get_height(parent)) { if(lv_obj_get_height(label) > lv_obj_get_height(parent)) {
anim.end = lv_obj_get_height(parent) - lv_obj_get_height(label) - anim.end = lv_obj_get_height(parent) - lv_obj_get_height(label) -
(font_get_height(font) - FONT_ANTIALIAS); (font_get_height(font) >> FONT_ANTIALIAS);
anim.fp = (anim_fp_t)lv_obj_set_y; anim.fp = (anim_fp_t)lv_obj_set_y;
/*Different animation speed if horizontal animation is created too*/ /*Different animation speed if horizontal animation is created too*/
...@@ -662,7 +665,7 @@ static void lv_label_refr_text(lv_obj_t * label) ...@@ -662,7 +665,7 @@ static void lv_label_refr_text(lv_obj_t * label)
if(size.y > lv_obj_get_height(label)) { if(size.y > lv_obj_get_height(label)) {
anim.end = lv_obj_get_height(label) - size.y - anim.end = lv_obj_get_height(label) - size.y -
(font_get_height(font) - FONT_ANTIALIAS); (font_get_height(font) >> FONT_ANTIALIAS);
anim.fp = (anim_fp_t)lv_label_set_offset_y; anim.fp = (anim_fp_t)lv_label_set_offset_y;
/*Different animation speed if horizontal animation is created too*/ /*Different animation speed if horizontal animation is created too*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment