Integer scale fix for windowed mode

This commit is contained in:
twinaphex 2020-01-02 10:05:18 +01:00
parent 643b3a73a4
commit 4ec9fe5a57

View File

@ -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;
}