From 06630f629485da754f50b7dae3b22263c0cf39d2 Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Wed, 23 Nov 2016 19:47:41 +0100 Subject: [PATCH] datmenu.cpp: fixed the mouse hover state drawing. (nw) --- src/frontend/mame/ui/datmenu.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index 3ec47e1979b..e8bb21d1f3a 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -210,9 +210,6 @@ void menu_dats_view::draw(uint32_t flags) // if we're on the top line, display the up arrow if (linenum == 0 && top_line != 0) { - draw_arrow(0.5f * (x1 + x2) - 0.5f * ud_arrow_width, line_y + 0.25f * line_height, - 0.5f * (x1 + x2) + 0.5f * ud_arrow_width, line_y + 0.75f * line_height, fgcolor, ROT0); - if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1)) { fgcolor = UI_MOUSEOVER_COLOR; @@ -220,13 +217,14 @@ void menu_dats_view::draw(uint32_t flags) highlight(line_x0, line_y0, line_x1, line_y1, bgcolor); hover = HOVER_ARROW_UP; } + + draw_arrow(0.5f * (x1 + x2) - 0.5f * ud_arrow_width, line_y + 0.25f * line_height, + 0.5f * (x1 + x2) + 0.5f * ud_arrow_width, line_y + 0.75f * line_height, fgcolor, ROT0); + } // if we're on the bottom line, display the down arrow else if (linenum == m_visible_lines - 1 && itemnum != visible_items - 1) { - draw_arrow(0.5f * (x1 + x2) - 0.5f * ud_arrow_width, line_y + 0.25f * line_height, - 0.5f * (x1 + x2) + 0.5f * ud_arrow_width, line_y + 0.75f * line_height, fgcolor, ROT0 ^ ORIENTATION_FLIP_Y); - if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1)) { fgcolor = UI_MOUSEOVER_COLOR; @@ -234,6 +232,9 @@ void menu_dats_view::draw(uint32_t flags) highlight(line_x0, line_y0, line_x1, line_y1, bgcolor); hover = HOVER_ARROW_DOWN; } + + draw_arrow(0.5f * (x1 + x2) - 0.5f * ud_arrow_width, line_y + 0.25f * line_height, + 0.5f * (x1 + x2) + 0.5f * ud_arrow_width, line_y + 0.75f * line_height, fgcolor, ROT0 ^ ORIENTATION_FLIP_Y); } // draw dats text