1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

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
commit 3d315a891b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;