Go through menu_input_pointer_state more

This commit is contained in:
twinaphex 2015-09-24 17:21:50 +02:00
parent fb67a39d32
commit 670350dc1f
2 changed files with 10 additions and 7 deletions

View File

@ -233,12 +233,14 @@ static void glui_render(void)
if (settings->menu.pointer.enable)
{
int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS);
menu_input->pointer.ptr =
(menu_input->pointer.y - glui->line_height + menu->scroll_y - 16)
(pointer_y - glui->line_height + menu->scroll_y - 16)
/ glui->line_height;
menu->scroll_y -= menu_input->pointer.accel / 60.0;
menu_input->pointer.accel = menu_input->pointer.accel * 0.96;
menu->scroll_y -= menu_input->pointer.accel / 60.0;
menu_input->pointer.accel = menu_input->pointer.accel * 0.96;
}
if (settings->menu.mouse.enable)

View File

@ -1433,12 +1433,13 @@ static void xmb_render(void)
{
for (i = 0; i < end; i++)
{
float item_y1 = xmb->margins.screen.top + xmb_item_y(xmb, i, current);
float item_y2 = item_y1 + xmb->icon.size;
float item_y1 = xmb->margins.screen.top + xmb_item_y(xmb, i, current);
float item_y2 = item_y1 + xmb->icon.size;
int16_t pointer_y = menu_input_pointer_state(MENU_POINTER_Y_AXIS);
if (settings->menu.pointer.enable)
{
if (menu_input->pointer.y > item_y1 && menu_input->pointer.y < item_y2)
if (pointer_y > item_y1 && pointer_y < item_y2)
menu_input->pointer.ptr = i;
}