(XMB) Vertical Fade corrections (#13736)

This commit is contained in:
Tony 2022-03-12 17:50:56 +02:00 committed by GitHub
parent d9bc8fb796
commit c1216fd16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -3394,19 +3394,20 @@ static int xmb_draw_item(
if (menu_xmb_vertical_fade_factor)
{
float factor = menu_xmb_vertical_fade_factor / 100.0f / 0.004f;
float min_alpha = 0.1f;
float max_alpha = (i == current) ? xmb->items_active_alpha : xmb->items_passive_alpha;
float new_alpha = node->alpha;
float top_margin = xmb->margins_screen_top;
float icon_space = xmb->icon_spacing_vertical;
float icon_ratio = icon_space / height / icon_space * 4;
float scr_margin = xmb->margins_screen_top + (icon_space / icon_ratio / 400);
float factor = menu_xmb_vertical_fade_factor / 100.0f / icon_ratio;
/* Top */
if (node->y < 0)
new_alpha = (node->y + top_margin + (icon_space / 4)) / factor;
if (i < current)
new_alpha = (node->y + scr_margin) / factor;
/* Bottom */
else if (node->y > (height - (top_margin * 2)) && node->y < (height - top_margin + icon_space))
new_alpha = (height - node->y - top_margin + (icon_space / 4)) / factor;
else if (i > current)
new_alpha = (height - node->y - scr_margin + icon_space) / factor;
/* Rest need to reset after vertical wrap-around */
else if (node->x == 0 && node->alpha > 0 && node->alpha != max_alpha)
new_alpha = max_alpha;

View File

@ -16136,7 +16136,7 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].action_left = &setting_uint_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh;
menu_settings_list_current_add_range(list, list_info, 0, 300, 1, true, true);
menu_settings_list_current_add_range(list, list_info, 0, 500, 1, true, true);
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_PATH(