This commit is contained in:
Casey 2022-02-01 15:52:19 +03:00
parent 041ba4b10c
commit 12da7b2ad9
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ void get_size_keep_aspect(int w, int h, int dw, int dh, int *ow, int *oh)
{
tmp_1 = floor(dh * ratio);
tmp_2 = ceil(dh * ratio);
if (fabsf(ratio - (float)tmp_1 / dh) < fabsf(ratio - (float)tmp_1 / dh))
if (fabsf(ratio - (float)tmp_1 / dh) < fabsf(ratio - (float)tmp_w / dh))
*ow = tmp_1 < 1 ? 1 : tmp_1;
else
*ow = tmp_2 < 1 ? 1 : tmp_2;