mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Simplify code
This commit is contained in:
parent
41a8661bdf
commit
6e2a1895f6
@ -3883,7 +3883,7 @@ static void xmb_render(void *data,
|
|||||||
if ((pointer_x > margin_left) && (pointer_x < margin_right))
|
if ((pointer_x > margin_left) && (pointer_x < margin_right))
|
||||||
{
|
{
|
||||||
unsigned first = 0;
|
unsigned first = 0;
|
||||||
unsigned last = end;
|
unsigned last = (unsigned)end;
|
||||||
|
|
||||||
if (height)
|
if (height)
|
||||||
xmb_calculate_visible_range(xmb, height,
|
xmb_calculate_visible_range(xmb, height,
|
||||||
@ -7055,8 +7055,8 @@ static int xmb_pointer_up(void *userdata,
|
|||||||
/* Swipe down between left and right margins:
|
/* Swipe down between left and right margins:
|
||||||
* move selection pointer up by 1 'page' */
|
* move selection pointer up by 1 'page' */
|
||||||
unsigned bottom_idx = (unsigned)selection + 1;
|
unsigned bottom_idx = (unsigned)selection + 1;
|
||||||
size_t new_idx;
|
size_t new_idx = 0;
|
||||||
unsigned step;
|
unsigned step = 0;
|
||||||
|
|
||||||
/* Determine index of entry at bottom of screen
|
/* Determine index of entry at bottom of screen
|
||||||
* Note: cannot use xmb_calculate_visible_range()
|
* Note: cannot use xmb_calculate_visible_range()
|
||||||
@ -7066,7 +7066,8 @@ static int xmb_pointer_up(void *userdata,
|
|||||||
* selection... */
|
* selection... */
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
float top = xmb_item_y(xmb, bottom_idx, selection) + xmb->margins_screen_top;
|
float top = xmb_item_y(xmb, bottom_idx, selection)
|
||||||
|
+ xmb->margins_screen_top;
|
||||||
|
|
||||||
if (top > height)
|
if (top > height)
|
||||||
{
|
{
|
||||||
@ -7080,8 +7081,10 @@ static int xmb_pointer_up(void *userdata,
|
|||||||
bottom_idx++;
|
bottom_idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
step = (bottom_idx >= selection) ? bottom_idx - selection : 0;
|
if (bottom_idx >= selection)
|
||||||
new_idx = (selection > step) ? selection - step : 0;
|
step = bottom_idx - selection;
|
||||||
|
if (selection > step)
|
||||||
|
new_idx = selection - step;
|
||||||
|
|
||||||
if (new_idx > 0)
|
if (new_idx > 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user