From 47bdf497b6a6eac52a143ca7f1665217f19dbc4f Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 14 Dec 2018 14:24:47 -0800 Subject: [PATCH] Fix lv_group wrap behavior when removing head or tail object from group --- lv_core/lv_group.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lv_core/lv_group.c b/lv_core/lv_group.c index 17190f428..e1d216a75 100644 --- a/lv_core/lv_group.c +++ b/lv_core/lv_group.c @@ -340,10 +340,15 @@ void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t p } static void lv_group_refocus(lv_group_t *g) { - if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_NEXT) - lv_group_focus_next(g); - else if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_PREV) - lv_group_focus_prev(g); + /*Refocus must temporarily allow wrapping to work correctly*/ + uint8_t temp_wrap = g->wrap; + + if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_NEXT) + lv_group_focus_next(g); + else if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_PREV) + lv_group_focus_prev(g); + /*Restore wrap property*/ + g->wrap = temp_wrap; } /**