diff --git a/menu/menu_iterate.c b/menu/menu_iterate.c index 5948d03ce0..36dbf55499 100644 --- a/menu/menu_iterate.c +++ b/menu/menu_iterate.c @@ -232,7 +232,10 @@ static int action_iterate_menu_viewport(char *s, size_t len, { case MENU_ACTION_UP: if (type == MENU_SETTINGS_CUSTOM_VIEWPORT) + { custom->y -= stride_y; + custom->height += stride_y; + } else if (custom->height >= (unsigned)stride_y) custom->height -= stride_y; @@ -241,7 +244,11 @@ static int action_iterate_menu_viewport(char *s, size_t len, case MENU_ACTION_DOWN: if (type == MENU_SETTINGS_CUSTOM_VIEWPORT) - custom->y += stride_y; + { + custom->y += stride_y; + if (custom->height >= (unsigned)stride_y) + custom->height -= stride_y; + } else custom->height += stride_y; @@ -250,7 +257,10 @@ static int action_iterate_menu_viewport(char *s, size_t len, case MENU_ACTION_LEFT: if (type == MENU_SETTINGS_CUSTOM_VIEWPORT) + { custom->x -= stride_x; + custom->width += stride_x; + } else if (custom->width >= (unsigned)stride_x) custom->width -= stride_x; @@ -259,7 +269,11 @@ static int action_iterate_menu_viewport(char *s, size_t len, case MENU_ACTION_RIGHT: if (type == MENU_SETTINGS_CUSTOM_VIEWPORT) - custom->x += stride_x; + { + custom->x += stride_x; + if (custom->width >= (unsigned)stride_x) + custom->width -= stride_x; + } else custom->width += stride_x;