Implement fill scale mode

This commit is contained in:
Berke Kocaoğlu
2021-04-14 20:10:14 +03:00
committed by Berke Kocaoğlu
parent 1d28627868
commit 88f77bc59c
5 changed files with 10 additions and 2 deletions

View File

@ -402,6 +402,9 @@ bool img_fit(img_t *img)
zh = (float) img->win->h / (float) img->h;
switch (img->scalemode) {
case SCALE_FILL:
z = MAX(zw, zh);
break;
case SCALE_WIDTH:
z = zw;
break;