use roundf for maintas

This commit is contained in:
FunkyFr3sh 2023-12-29 01:40:49 +01:00
parent ff1c8fb0a3
commit 988cad0200
3 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,6 @@
#include <windows.h>
#include <intrin.h>
#include <math.h>
#include "ddraw.h"
#include "debug.h"
#include "dd.h"
@ -381,11 +382,11 @@ void util_toggle_maximize()
dst_rc.top = 0;
dst_rc.left = 0;
dst_rc.right = w;
dst_rc.bottom = (LONG)(((float)g_ddraw->height / g_ddraw->width) * w);
dst_rc.bottom = (LONG)roundf(((float)g_ddraw->height / g_ddraw->width) * w);
if (dst_rc.bottom > h)
{
dst_rc.right = (LONG)(((float)dst_rc.right / dst_rc.bottom) * h);
dst_rc.right = (LONG)roundf(((float)dst_rc.right / dst_rc.bottom) * h);
dst_rc.bottom = h;
}