mirror of
https://github.com/holub/mame
synced 2025-04-28 19:14:55 +03:00
Merge pull request #1766 from dankan1890/master
datmenu.cpp: fixed the mouse hover state drawing. (nw)
This commit is contained in:
commit
99da17aed6
@ -210,9 +210,6 @@ void menu_dats_view::draw(uint32_t flags)
|
|||||||
// if we're on the top line, display the up arrow
|
// if we're on the top line, display the up arrow
|
||||||
if (linenum == 0 && top_line != 0)
|
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))
|
if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1))
|
||||||
{
|
{
|
||||||
fgcolor = UI_MOUSEOVER_COLOR;
|
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);
|
highlight(line_x0, line_y0, line_x1, line_y1, bgcolor);
|
||||||
hover = HOVER_ARROW_UP;
|
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
|
// if we're on the bottom line, display the down arrow
|
||||||
else if (linenum == m_visible_lines - 1 && itemnum != visible_items - 1)
|
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))
|
if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1))
|
||||||
{
|
{
|
||||||
fgcolor = UI_MOUSEOVER_COLOR;
|
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);
|
highlight(line_x0, line_y0, line_x1, line_y1, bgcolor);
|
||||||
hover = HOVER_ARROW_DOWN;
|
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
|
// draw dats text
|
||||||
|
Loading…
Reference in New Issue
Block a user