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:
commit
3d315a891b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user