Merge pull request #271 from upbeat27/page_focus_fix

Fix page focus not focusing objects the same way when moving up or down the page
This commit is contained in:
Gabor Kiss-Vamosi
2018-06-12 12:44:17 +02:00
committed by GitHub
+2 -2
View File
@@ -303,9 +303,9 @@ void lv_page_focus(lv_obj_t * page, lv_obj_t * obj, uint16_t anim_time)
else if((obj_h <= page_h && bot_err > 0) ||
(obj_h > page_h && top_err >= bot_err)) {
/*Calculate a new position and let some space below*/
scrlable_y = -obj_y;
scrlable_y += page_h - obj_h;
scrlable_y = -(obj_y + style_scrl->body.padding.ver + style->body.padding.ver);
scrlable_y -= style_scrl->body.padding.ver;
scrlable_y += page_h - obj_h;
} else {
/*Already in focus*/
return;