diff options
author | Vas Crabb <vas@vastheman.com> | 2016-11-23 12:48:41 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2016-11-23 12:48:41 +1100 |
commit | 95254fb277e927adf36580e0822f5ce4f8267e49 (patch) | |
tree | dcea794c341b0f918e0b2f635805fa8c0dc1329e /src/frontend/mame/ui/selsoft.cpp | |
parent | 32c256eccc827d2708c6c270c5c59df4b8a6ae01 (diff) |
encapsulate mouse translation in the menu code, make more stuff const
Diffstat (limited to 'src/frontend/mame/ui/selsoft.cpp')
-rw-r--r-- | src/frontend/mame/ui/selsoft.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 899605f04a0..7e267c98987 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -1139,7 +1139,7 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float rgb_t bgcolor = UI_TEXT_BG_COLOR; rgb_t fgcolor = UI_TEXT_COLOR; - if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y1 + line_height > mouse_y) + if (mouse_in_rect(x1, y1, x2, y1 + line_height)) { bgcolor = UI_MOUSEOVER_BG_COLOR; fgcolor = UI_MOUSEOVER_COLOR; @@ -1209,7 +1209,7 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float ui().draw_outlined_box(container(), x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); - if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y2 > mouse_y) + if (mouse_in_rect(x1, y1, x2, y2)) { fgcolor = UI_MOUSEOVER_COLOR; hover = HOVER_LPANEL_ARROW; @@ -1232,7 +1232,7 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float ui().draw_outlined_box(container(), x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); - if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y2 > mouse_y) + if (mouse_in_rect(x1, y1, x2, y2)) { fgcolor = UI_MOUSEOVER_COLOR; hover = HOVER_LPANEL_ARROW; |