From 5395cbcea2ba20478753e121208aad75c0ae6605 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 27 Aug 2024 02:34:48 +1000 Subject: [PATCH] -ui/menu.cpp: Avoid floating point equality comparison. * Fixes pointer input not working on menus at some window sizes in 32-bit x86 builds. -leapfrog_leappad_cart.xml: Fixed a description. --- hash/leapfrog_leappad_cart.xml | 2 +- src/frontend/mame/ui/menu.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hash/leapfrog_leappad_cart.xml b/hash/leapfrog_leappad_cart.xml index df1e8b88f11f1..a093848c7f60c 100644 --- a/hash/leapfrog_leappad_cart.xml +++ b/hash/leapfrog_leappad_cart.xml @@ -201,7 +201,7 @@ license:CC0-1.0 - FUN-damentals Series - Smart Guide to 4rd Grade (UK) + FUN-damentals Series - Smart Guide to 4th Grade (UK) 2002 LeapFrog diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index d6b6d29fccf41..740a310e2f50d 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -27,6 +27,7 @@ #include "osdepend.h" #include +#include #include #include #include @@ -1930,7 +1931,7 @@ bool menu::check_metrics() render_target &target(render.ui_target()); std::pair const uisize(target.width(), target.height()); float const aspect = render.ui_aspect(&container()); - if ((uisize == m_last_size) && (aspect == m_last_aspect)) + if ((uisize == m_last_size) && (std::fabs(1.0F - (aspect / m_last_aspect)) < 1e-6F)) return false; m_last_size = uisize;