Skip to content

Commit

Permalink
-ui/menu.cpp: Avoid floating point equality comparison.
Browse files Browse the repository at this point in the history
* Fixes pointer input not working on menus at some window sizes in
  32-bit x86 builds.

-leapfrog_leappad_cart.xml: Fixed a description.
  • Loading branch information
cuavas committed Aug 26, 2024
1 parent 617d79b commit 5395cbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hash/leapfrog_leappad_cart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ license:CC0-1.0
</software>

<software name="smartguid4" supported="no">
<description>FUN-damentals Series - Smart Guide to 4rd Grade (UK)</description>
<description>FUN-damentals Series - Smart Guide to 4th Grade (UK)</description>
<year>2002</year>
<publisher>LeapFrog</publisher>
<info name="serial" value="500-00534"/>
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/mame/ui/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "osdepend.h"

#include <cassert>
#include <cmath>
#include <cstdlib>
#include <limits>
#include <type_traits>
Expand Down Expand Up @@ -1930,7 +1931,7 @@ bool menu::check_metrics()
render_target &target(render.ui_target());
std::pair<uint32_t, uint32_t> 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;
Expand Down

0 comments on commit 5395cbc

Please sign in to comment.