diff --git a/retroarch.c b/retroarch.c index e264253723..7d9dce27d3 100644 --- a/retroarch.c +++ b/retroarch.c @@ -21388,8 +21388,10 @@ void video_viewport_get_scaled_integer(struct video_viewport *vp, if (keep_aspect) { /* X/Y scale must be same. */ - unsigned max_scale = MIN(width / base_width, - height / base_height); + unsigned max_scale = MIN( + (unsigned)roundf((float)width / base_width), + (unsigned)roundf((height / base_height))); + padding_x = width - base_width * max_scale; padding_y = height - base_height * max_scale; }