From f6e054ba738681943e8960b8646ab768c6395bc1 Mon Sep 17 00:00:00 2001 From: Josh McAtee Date: Mon, 11 Jun 2018 16:00:30 -0700 Subject: [PATCH] Fix page focus not focusing objects the same way when moving up or down the page --- lv_objx/lv_page.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index 2f0c0fcc9..518f64a53 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -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;