summaryrefslogtreecommitdiffstats
path: root/src/emu/render.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-02-03 17:45:21 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-02-03 17:45:21 -0500
commitbcf647342a9643fedfba6d9ebc3be56bcc4c1cf1 (patch)
treefb2c32cc05cc43803f19ba8b0a2fc661ef0d5cd0 /src/emu/render.cpp
parent0c57408ed81194046b56318dd6fd8583f8de44b3 (diff)
Use std::clamp in various core functions
Diffstat (limited to 'src/emu/render.cpp')
-rw-r--r--src/emu/render.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 3ef1fb32fec..5e2c023bf4e 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -1216,8 +1216,8 @@ void render_target::compute_visible_area(s32 target_width, s32 target_height, fl
// now apply desired scale mode and aspect correction
if (m_keepaspect && target_aspect > src_aspect) xscale *= src_aspect / target_aspect * (maxyscale / yscale);
if (m_keepaspect && target_aspect < src_aspect) yscale *= target_aspect / src_aspect * (maxxscale / xscale);
- if (x_is_integer) xscale = std::min(maxxscale, std::max(1.0f, render_round_nearest(xscale)));
- if (y_is_integer) yscale = std::min(maxyscale, std::max(1.0f, render_round_nearest(yscale)));
+ if (x_is_integer) xscale = std::clamp(render_round_nearest(xscale), 1.0f, maxxscale);
+ if (y_is_integer) yscale = std::clamp(render_round_nearest(yscale), 1.0f, maxyscale);
// check if we have user defined scale factors, if so use them instead
int user_scale_x = target_is_portrait? m_int_scale_y : m_int_scale_x;