diff options
author | 2024-09-27 02:57:52 +1000 | |
---|---|---|
committer | 2024-09-27 02:57:52 +1000 | |
commit | 0125087cbe3ce69cbd99fb4f65c8ece580e0dd8b (patch) | |
tree | 76b3f1260e1b8f54e4b04ff6b233c2093ea18dc0 /src/emu/render.cpp | |
parent | b1139717362c93fe0aa9ccbda98a6eceb72162a3 (diff) |
-emu/render.cpp: Always translate coordinates if container is found (fixes GitHub #12817).
-ui/videoopt.cpp, ui/ui.cpp: Allow pressing UI Clear to restore default
pointer timeout settings.
- midway/starrider.cpp: Added PROTO 3 program ROMs.
New clones marked not working
-----------------------------
Star Rider (PROTO 3) [Matt Ownby]
Diffstat (limited to 'src/emu/render.cpp')
-rw-r--r-- | src/emu/render.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 571f4e79084..545827262bb 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1756,13 +1756,9 @@ bool render_target::map_point_container(s32 target_x, s32 target_y, render_conta if (&container == m_ui_container) { // this hit test went against the UI container - if ((target_f.first >= 0.0f) && (target_f.first < 1.0f) && (target_f.second >= 0.0f) && (target_f.second < 1.0f)) - { - // this point was successfully mapped - container_x = float(target_x) / m_width; - container_y = float(target_y) / m_height; - return true; - } + container_x = float(target_x) / m_width; + container_y = float(target_y) / m_height; + return (target_f.first >= 0.0f) && (target_f.first < 1.0f) && (target_f.second >= 0.0f) && (target_f.second < 1.0f); } else { @@ -1781,15 +1777,12 @@ bool render_target::map_point_container(s32 target_x, s32 target_y, render_conta [&container] (layout_view_item &item) { return &item.screen()->container() == &container; })); if (items.end() != found) { + // point successfully mapped layout_view_item &item(*found); render_bounds const bounds(item.bounds()); - if (bounds.includes(target_f.first, target_f.second)) - { - // point successfully mapped - container_x = (target_f.first - bounds.x0) / bounds.width(); - container_y = (target_f.second - bounds.y0) / bounds.height(); - return true; - } + container_x = (target_f.first - bounds.x0) / bounds.width(); + container_y = (target_f.second - bounds.y0) / bounds.height(); + return bounds.includes(target_f.first, target_f.second); } } |