From 73210eb290c3776317c197a9faa535a62475ee49 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 31 Dec 2024 04:33:31 +1100 Subject: ui/selmenu.cpp: Don't rescale icons that are close to the target size. --- src/frontend/mame/ui/selmenu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 240bbd2b663..c32f04d27e6 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -1363,18 +1363,18 @@ bool menu_select_launch::scale_icon(bitmap_argb32 &&src, texture_and_bitmap &dst { // scale the source bitmap bitmap_argb32 tmp; - float const ratio((std::min)({ float(m_icon_height) / src.height(), float(m_icon_width) / src.width() })); - if (1.0F == ratio) - { - tmp = std::move(src); - } - else + float const ratio((std::min)(float(m_icon_height) / src.height(), float(m_icon_width) / src.width())); + if ((1.0F > ratio) || (1.2F < ratio)) { float const pix_height(std::ceil(src.height() * ratio)); float const pix_width(std::ceil(src.width() * ratio)); tmp.allocate(s32(pix_width), s32(pix_height)); render_resample_argb_bitmap_hq(tmp, src, render_color{ 1.0F, 1.0F, 1.0F, 1.0F }, true); } + else + { + tmp = std::move(src); + } // copy into the destination dst.bitmap.allocate(m_icon_width, m_icon_height); -- cgit v1.2.3